-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntegrationTest.t.sol
32 lines (24 loc) · 977 Bytes
/
IntegrationTest.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import {Test} from "forge-std/Test.sol";
import {FundMe} from "../../src/FundMe.sol";
import {DeployFundMe} from "../../script/DeployFundMe.s.sol";
import {FundFundMe, WithdrawFundMe} from "../../script/Integrations.s.sol";
contract IntegrationTest is Test {
FundMe public fundMe;
address USER = makeAddr("Abhay");
uint256 constant SEND_AMOUNT = 0.1 ether;
uint256 constant STARTING_BALANCE = 10 ether;
function setUp() external {
DeployFundMe deployFundMe = new DeployFundMe();
fundMe = deployFundMe.run();
vm.deal(USER, STARTING_BALANCE);
}
function testUserCanFundIntegrations() public {
FundFundMe fundFundMe = new FundFundMe();
fundFundMe.fundFundMe(address(fundMe));
WithdrawFundMe withdrawFundMe = new WithdrawFundMe();
withdrawFundMe.withdrawFundMe(address(fundMe));
assert(address(fundMe).balance == 0);
}
}