如何验证OCMock 3从未调用过某个方法?
我在想这样的事情:
XCTAssertThrows(OCMVerify([_restDataSource getSomeStuff:[OCMArg any]]));
但是似乎OCMVerify不会失败。
请参阅http://ocmock.org/reference/#advanced-topics下的第一点
请注意,reject
此时需要使用旧式语法,并且必须在调用方法之前将其调用。
// first set up the mock
[[mock reject] methodThatShouldNotBeCalled]
// then call method that should not result in the call
要了解计划的内容,请参阅https://github.com/erikdoe/ocmock/issues/109
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句