Hi I had a problem when testing a method that send a object message when I Run, the test failed and show me this error:
failed: caught "NSInvalidArgumentException", "*** -[NSProxy doesNotRecognizeSelector:sendMessage:] called!"
this is my test method :
- (void)testSendingRequests
{
MNRequest *request = [MNRequest requestWithType:@"AUselessType"
content:@"AUselessContent"
delegate:nil
timeOut:10
userInfo:nil];
MNMessage * message = mockClass([MNMessage class]);
[given([mockMsgCenter sendMessage:message]) willDo:^id(NSInvocation *invocation) {
// Mock implementation goes here
}
NSNumber *identificationNumber = [center sendRequest:request];
verify(mockMsgCenter);
// some other code
}