Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 OCMock,这样每当someMethod使用任何参数调用时,它都会callBackMethod:使用参数“dict”调用,这是一个NSDictionary. 我发现andCall:onObject:了,但这似乎并没有让你通过争论。有没有办法获得这种期望的行为?
someMethod
callBackMethod:
NSDictionary
andCall:onObject:
您可以andDo:在给定的块中使用和执行您想要的任何内容。
andDo:
id yourMock;//... NSDictionary *dictionary;//... id anObject;//... [[[yourMock stub] andDo:^(NSInvocation *invocation) { [anObject callBackMethod:dictionary]; }] someMethod];