forked from Northgate-Systems/RemitX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rs
More file actions
33 lines (31 loc) · 1.23 KB
/
Copy pathtest.rs
File metadata and controls
33 lines (31 loc) · 1.23 KB
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
33
//! Stub test file for the RemitX Escrow Contract.
//!
//! TODO(contributor): Add proper Soroban unit tests that:
//! - Deploy the contract with a test environment
//! - Call deposit() and verify the EscrowState is stored
//! - Call get_escrow() and verify the returned state
//! - Test release() once the authorization mechanism is decided
//! - Test refund() after expiry
//! - Test edge cases: double release, refund before expiry, etc.
#![cfg(test)]
// TODO(contributor): Write tests once the contract functions are implemented.
// Example test structure:
//
// #[test]
// fn test_deposit() {
// let env = Env::default();
// let contract_id = env.register_contract(None, EscrowContract);
// let client = EscrowContractClient::new(&env, &contract_id);
//
// let sender = Address::generate(&env);
// let recipient = Address::generate(&env);
// let asset = Address::generate(&env);
//
// let escrow_id = client.deposit(&sender, &recipient, &1000i128, &asset, &100000u64);
// let state = client.get_escrow(&escrow_id);
//
// assert_eq!(state.sender, sender);
// assert_eq!(state.recipient, recipient);
// assert_eq!(state.amount, 1000i128);
// assert_eq!(state.status, EscrowStatus::Locked);
// }