Skip to content

Commit

Permalink
test: trying to improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
0xashu committed May 21, 2024
1 parent 8465f05 commit 36bf0c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 0 additions & 11 deletions test/unit/SharesFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ contract SharesFactoryTests is BaseTest {
vm.warp(timestamp + 1 minutes);
}

function test_constructor() public view {
assertEq(aaveYieldAggregator.FACTORY(), address(sharesFactory));
assertEq(aaveYieldAggregator.WETH(), WETH);
assertEq(address(aaveYieldAggregator.aWETH()), address(aWETH));
assertEq(address(aaveYieldAggregator.AAVE_POOL()), AAVE_POOL);
assertEq(address(aaveYieldAggregator.AAVE_WETH_GATEWAY()), AAVE_WETH_GATEWAY);

assertEq(blankYieldAggregator.FACTORY(), address(sharesFactory));
assertEq(blankYieldAggregator.WETH(), WETH);
}

function test_mintShare() public {
vm.prank(addrAlice);
sharesFactory.mintShare(defaultCurveType);
Expand Down
16 changes: 16 additions & 0 deletions test/unit/YieldAggregator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

pragma solidity 0.8.25;

import { AaveYieldAggregator } from "contracts/core/aggregator/AaveYieldAggregator.sol";
import { BlankYieldAggregator } from "contracts/core/aggregator/BlankYieldAggregator.sol";
import { BaseTest } from "../BaseTest.t.sol";

contract YieldAggregatorTests is BaseTest {
Expand All @@ -11,6 +13,20 @@ contract YieldAggregatorTests is BaseTest {
createFactory();
}

function test_newAggregator() public {
AaveYieldAggregator aave = new AaveYieldAggregator(address(sharesFactory), WETH, AAVE_POOL, AAVE_WETH_GATEWAY);
assertEq(aave.yieldBuffer(), defaultYieldBuffer);
assertEq(aave.FACTORY(), address(sharesFactory));
assertEq(aave.WETH(), WETH);
assertEq(address(aave.AAVE_POOL()), AAVE_POOL);
assertEq(address(aave.AAVE_WETH_GATEWAY()), AAVE_WETH_GATEWAY);
assertEq(address(aave.aWETH()), address(aWETH));

BlankYieldAggregator blank = new BlankYieldAggregator(address(sharesFactory), WETH);
assertEq(blank.FACTORY(), address(sharesFactory));
assertEq(blank.WETH(), WETH);
}

function test_setYieldBuffer() public {
vm.prank(owner);
aaveYieldAggregator.setYieldBuffer(1e11);
Expand Down

0 comments on commit 36bf0c7

Please sign in to comment.