Skip to content

Commit

Permalink
Feature: Add test for Team Withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
imsoso committed Nov 4, 2024
1 parent 451eeb7 commit 1969a71
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions solidity-scripting/src/W4D2/test/MyIDOTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,19 @@ contract MyIDOTest is Test {
vm.expectRevert("Cannot do it, Funding target reached");
myIDO.refund();
}

function testTeamWithdraw() public payable{
vm.deal(contributorAlice, 1000 ether);
vm.prank(contributorAlice);
myIDO.contribute{value: 100 ether}();

vm.deal(address(this), 0);
myIDO.teamWithdrawFunds();
uint256 teamEthBalance = address(this).balance;
assertEq(teamEthBalance, 10 ether, "Team's eth balance should be 10");
}

receive() external payable {

}
}

0 comments on commit 1969a71

Please sign in to comment.