Skip to content

Commit

Permalink
added controller tests
Browse files Browse the repository at this point in the history
Signed-off-by: chrismaree <[email protected]>
  • Loading branch information
chrismaree committed May 20, 2024
1 parent 5d8409b commit 16960de
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/BaseController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,17 @@ contract OvalUnlockLatestValue is CommonTest {
vm.expectRevert("Ownable: caller is not the owner");
baseController.setMaxTraversal(100);
}

function testOwnerCanSetMaxAge() public {
uint256 newMaxAge = 7200; // 2 hours in seconds, different from default 1 day
vm.prank(owner);
baseController.setMaxAge(newMaxAge);
assertTrue(baseController.maxAge() == newMaxAge);
}

function testNonOwnerCannotSetMaxAge() public {
vm.prank(random);
vm.expectRevert("Ownable: caller is not the owner");
baseController.setMaxAge(7200);
}
}

0 comments on commit 16960de

Please sign in to comment.