OxL Справочник OxL
РусскийEnglish

fn oxlMockHit

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

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Параметры

ИмяТип
keyi64

Возвращает

i64

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/testing.oxl:210

См. также