Hello,
Is there an option in Cuckoo to use after or other delay option with matcher? Something similar to: VerificationAfterDelay
For now I combined it with expectations but I am not sure whether it's the best way.
func test() {
let exp = expectation(description: "testShow")
exp.expectedFulfillmentCount = 1
delay(1.0) { // async after
verify(view).show()
exp.fulfill() // always fulfill
}
wait(for: [exp], timeout: 2.0)
}
USE CASE:
I wanted to test whether some methods were invoked in Presenter which used Timer. I could of course mock this Timer as it is usually done with API requests but for such simple scenario I think delay in verify would be better.
Regards
Hello,
Is there an option in Cuckoo to use
afteror otherdelayoption with matcher? Something similar to: VerificationAfterDelayFor now I combined it with
expectationsbut I am not sure whether it's the best way.USE CASE:
I wanted to test whether some methods were invoked in
Presenterwhich usedTimer. I could of course mock thisTimeras it is usually done with API requests but for such simple scenario I think delay in verify would be better.Regards