Skip to content

Commit

Permalink
add testing for fix fund
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocodecr committed Nov 3, 2024
1 parent 5c5265b commit 7e76e02
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contracts/tests/test_fund_manager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ fn REASON() -> ByteArray {
fn GOAL() -> u256 {
1000
}
fn BAD_GOAL() -> u256 {
400
}

fn _setup_() -> (ContractAddress, ClassHash) {
// Fund
Expand Down Expand Up @@ -82,6 +85,14 @@ fn test_new_fund() {
assert(current_id == 2, 'Invalid current ID');
}

#[test]
#[should_panic(expected: 'Goal must be at least 500')]
fn test_new_fund_bad_goal() {
start_cheat_caller_address_global(OWNER());
let (contract_address, _) = _setup_();
let fund_manager_contract = IFundManagerDispatcher { contract_address };
fund_manager_contract.newFund(NAME(), BAD_GOAL());
}

#[test]
fn test_fund_deployed_event() {
Expand Down

0 comments on commit 7e76e02

Please sign in to comment.