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

fn oxlMockCallsOf

S.calls(.m) -> List<Call> (§18.3): the calls of one mocked rpc, oldest first (.count, [i], .all(c => …), D-7250); svc is the service as written in the test (matched against the end of its qualified name, D-6103).

Example:

oxl✓ проверяется в CI
service Ledger {
  @public rpc note(n: i64) -> i64
}

impl Ledger {
  rpc note(n) => n
}

test "calls of a mocked rpc" {
  mock Ledger {
    note(n) => n
  }
  let _ = Ledger.note(7)
  assert_eq(Ledger.calls(.note).count, 1)
}
pub(api) fn oxlMockCallsOf(svc: str, m: str) -> List<Call>

Сложность. O(calls).

С версии. 1.0.0-beta

Параметры

ИмяТип
svcstr
mstr

Возвращает

List<Call>

Эффекты

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

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

См. также