Can we have this testing documentation to be further elaborated including usage and file directory explicit documentation which is used in the next documentation example
This is the Rust Test documentation elaboration :
Can the dev team include how do you call the test functions
Do include this example for calling functions where methods
must be used. Was confused why it wasn’t working.
#[tokio::test]
async fn test_harness() {
// Test code here
let (instance, _id) = get_contract_instance().await;
let result = instance.deposit(); // Wrong
let result = instance.methods().deposit(); // Correct
}
Error for not including methods
error[E0599]: no method named `deposit` found for struct `MyContract` in the current scope
--> tests/harness.rs:11:27
|
3 | abigen!(Contract(name="MyContract", abi="out/debug/test_asset-abi.json"));
| ------------------------------------------------------------------------- method `deposit` not found for this struct
...
11 | let result = instance.deposit().await;
| ^^^^^^^ method not found in `MyContract<WalletUnlocked>`