Skip to content

Commit

Permalink
Merge pull request #52 from KeneePatel/add-test
Browse files Browse the repository at this point in the history
Added Sample Test
  • Loading branch information
Darlington02 authored Apr 23, 2024
2 parents f923691 + 2df4ff3 commit 26c22c2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion contracts/tests/test_contract.cairo
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
// contract test in here
use snforge_std::{ declare, ContractClassTrait };
use contracts::{ IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait };

#[test]
fn test_balance() {
let contract = declare("HelloStarknet");
let contract_address = contract.deploy(@ArrayTrait::new()).unwrap();

let dispatcher = IHelloStarknetDispatcher { contract_address };

let balance = dispatcher.get_balance();
assert(balance == 0, 'Balance is wrong');

dispatcher.increase_balance(69);

let updated_balance = dispatcher.get_balance();
assert(updated_balance == 69, 'Balance wasnt updated correctly');
}

0 comments on commit 26c22c2

Please sign in to comment.