When I want to check that in one method the layout object receives some messages in a specific order, I do something like this:
// sut is an instance of the class I am testing and myMock is a mock object injected in sut. // I want to test that myMock sends messageA and then messageB, in that particular order. [[[myMock expect] andDo:^(NSInvocation *invocation) { [[myMock expect] messageB]; }] messageA]; [sut methodToTest]; [myMock verify];
Is there a cleaner / better way to do this? Thanks in advance.
e1985 source share