From 36bf0c796581a405f95ef46bdf66146df3ce8347 Mon Sep 17 00:00:00 2001 From: ashu Date: Tue, 21 May 2024 16:18:25 +0800 Subject: [PATCH] test: trying to improve test coverage --- test/unit/SharesFactory.t.sol | 11 ----------- test/unit/YieldAggregator.t.sol | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/test/unit/SharesFactory.t.sol b/test/unit/SharesFactory.t.sol index 4047bcb..f5f1d32 100644 --- a/test/unit/SharesFactory.t.sol +++ b/test/unit/SharesFactory.t.sol @@ -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); diff --git a/test/unit/YieldAggregator.t.sol b/test/unit/YieldAggregator.t.sol index bc08046..079a2b7 100644 --- a/test/unit/YieldAggregator.t.sol +++ b/test/unit/YieldAggregator.t.sol @@ -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 { @@ -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);