Skip to content

Commit

Permalink
test: specific tests (#25)
Browse files Browse the repository at this point in the history
* test: specific tests

* fix: add solc to toml
  • Loading branch information
Schlagonia authored Dec 8, 2023
1 parent 63beb7c commit 5015586
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
src = 'src'
out = 'out'
libs = ['lib']
solc = "0.8.18"

remappings = [
"@openzeppelin/=lib/openzeppelin-contracts/",
Expand Down
12 changes: 9 additions & 3 deletions src/test/Operation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ contract OperationTest is Setup {
mintAndDepositIntoStrategy(strategy, user, _amount);

// TODO: Implement logic so totalDebt is _amount and totalIdle = 0.
checkStrategyTotals(strategy, _amount, 0, _amount);
assertEq(strategy.totalAssets(), _amount, "!totalAssets");
assertEq(strategy.totalDebt(), 0, "!totalDebt");
assertEq(strategy.totalIdle(), _amount, "!totalIdle");

// Earn Interest
skip(1 days);
Expand Down Expand Up @@ -65,7 +67,9 @@ contract OperationTest is Setup {
mintAndDepositIntoStrategy(strategy, user, _amount);

// TODO: Implement logic so totalDebt is _amount and totalIdle = 0.
checkStrategyTotals(strategy, _amount, 0, _amount);
assertEq(strategy.totalAssets(), _amount, "!totalAssets");
assertEq(strategy.totalDebt(), 0, "!totalDebt");
assertEq(strategy.totalIdle(), _amount, "!totalIdle");

// Earn Interest
skip(1 days);
Expand Down Expand Up @@ -111,7 +115,9 @@ contract OperationTest is Setup {
mintAndDepositIntoStrategy(strategy, user, _amount);

// TODO: Implement logic so totalDebt is _amount and totalIdle = 0.
checkStrategyTotals(strategy, _amount, 0, _amount);
assertEq(strategy.totalAssets(), _amount, "!totalAssets");
assertEq(strategy.totalDebt(), 0, "!totalDebt");
assertEq(strategy.totalIdle(), _amount, "!totalIdle");

// Earn Interest
skip(1 days);
Expand Down
8 changes: 6 additions & 2 deletions src/test/Shutdown.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ contract ShutdownTest is Setup {
mintAndDepositIntoStrategy(strategy, user, _amount);

// TODO: Implement logic so totalDebt is _amount and totalIdle = 0.
checkStrategyTotals(strategy, _amount, 0, _amount);
assertEq(strategy.totalAssets(), _amount, "!totalAssets");
assertEq(strategy.totalDebt(), 0, "!totalDebt");
assertEq(strategy.totalIdle(), _amount, "!totalIdle");

// Earn Interest
skip(1 days);
Expand All @@ -25,7 +27,9 @@ contract ShutdownTest is Setup {
strategy.shutdownStrategy();

// TODO: Implement logic so totalDebt is _amount and totalIdle = 0.
checkStrategyTotals(strategy, _amount, 0, _amount);
assertEq(strategy.totalAssets(), _amount, "!totalAssets");
assertEq(strategy.totalDebt(), 0, "!totalDebt");
assertEq(strategy.totalIdle(), _amount, "!totalIdle");

// Make sure we can still withdraw the full amount
uint256 balanceBefore = asset.balanceOf(user);
Expand Down

0 comments on commit 5015586

Please sign in to comment.