-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from KeneePatel/add-test
Added Sample Test
- Loading branch information
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} |