From dd7b30597abb2665e6989abc9996a6f88a0d3309 Mon Sep 17 00:00:00 2001 From: Eridian <86061486+EridianAlpha@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:24:15 +0100 Subject: [PATCH] Implement GetMaxBorrowAndWithdrawUSDCAmount test --- test/unit/AavePM/GetterTest.t.sol | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/unit/AavePM/GetterTest.t.sol b/test/unit/AavePM/GetterTest.t.sol index de0c372..880e71e 100644 --- a/test/unit/AavePM/GetterTest.t.sol +++ b/test/unit/AavePM/GetterTest.t.sol @@ -151,9 +151,20 @@ contract AavePMGetterTests is AavePMTestSetup { assertEq(aavePM.getSuppliedCollateralTotal(), suppliedCollateral); } - // TODO: Implement this test - // function test_GetMaxBorrowAndWithdrawUSDCAmount() public { - // } + function test_GetMaxBorrowAndWithdrawUSDCAmount() public { + // Check initial maxBorrowAndWithdrawUSDCAmount is 0 + assertEq(aavePM.getMaxBorrowAndWithdrawUSDCAmount(), 0); + + // Send ETH from manager1 to the contract + vm.startPrank(manager1); + sendEth(address(aavePM), SEND_VALUE); + + // Supply ETH to Aave + aavePM.aaveSupplyFromContractBalance(); + + // Check that the maxBorrowAndWithdrawUSDCAmount is greater than 0 + assert(aavePM.getMaxBorrowAndWithdrawUSDCAmount() > 0); + } function test_GetReinvestableAmount() public { // Check initial reinvestable amount is 0.