我想验证一个函数没有被调用。该函数在测试函数内的异步块调用中执行,因此OCMReject()不起作用。
我测试是否确实调用了异步函数的方法如下:
id mock = OCMClassMock([SomeClass class]);
OCMExpect([mock methodThatShouoldExecute]);
OCMVerifyAllWithDelay(mock, 1);
Run Code Online (Sandbox Code Playgroud)
如何进行测试以测试是否未调用被禁止的函数?就像是:
VerifyNotCalled([mock methodThatShouoldExecute]);
OCMVerifyAllWithDelay(mock, 1);
Run Code Online (Sandbox Code Playgroud)