diff --git a/contracts/tests/test_contract.cairo b/contracts/tests/test_contract.cairo index a74fe02..823bd43 100644 --- a/contracts/tests/test_contract.cairo +++ b/contracts/tests/test_contract.cairo @@ -1 +1,18 @@ -// contract test in here \ No newline at end of file +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'); +}