fn oxlMockHit
How many earlier calls the mock arm key answered (the index of the response to give).
Example:
service Ledger {
@public rpc note(n: i64) -> i64
}
impl Ledger {
rpc note(n) => n
}
test "responses in turn" {
mock Ledger {
note(n) => [10, 20]
}
assert_eq(Ledger.note(1)!, 10)
assert_eq(Ledger.note(1)!, 20)
}pub(api) fn oxlMockHit(key: i64) -> i64Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
key | i64 |
Returns
i64
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/testing.oxl:210