OxL Reference

fn oxlMockHit

How many earlier calls the mock arm key answered (the index of the response to give).

Example:

oxl✓ checked in CI
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) -> i64

Since. 1.0.0-beta

Parameters

NameType
keyi64

Returns

i64

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/testing.oxl:210

See also