kw then
Contextual keyword — mock (§18.3)
The list of words: §1.4
Syntax
MockSeq = MockResp { "," "then" MockResp } ;Grammar: App. A
Defined in
- 18.3 Mocks — mock S { … } replaces a service, interface or actor within a test.
- 1.4 Keywords — Reserved (cannot be used as names)
Examples
mock Payments {
charge(_) => fail Timeout once, then Receipt{ id: 1 }
refund(id) if id > 0 => Ok always
}
assert Payments.calls(.charge).count == 2