나는있는 NSURLConnection의 동작을 테스트하려고 OCMock를 사용하고 여기에 불완전 시험은 다음과 같습니다."[NSProxy doesNotRecognizeSelector"...] "
#include "GTMSenTestCase.h"
#import <OCMock/OCMock.h>
@interface HttpTest : GTMTestCase
- (void)testShouldConnect;
@end
@implementation HttpTest
- (void)testShouldConnect {
id mock = [OCMockObject mockForClass:[NSURLConnection class]];
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:mock startImmediately:NO];
[[mock expect] connection:connection didReceiveResponse:OCMOCK_ANY];
}
@end
클래스와 조롱 분류 방법, 어떤 대리인 방법 연결 : didReceiveresponse : 내가 오류를 얻을 수 있습니다 :?
Unknown.m:0:0 Unknown.m:0: error: -[HttpTest testShouldConnect] : *** -[NSProxy doesNotRecognizeSelector:connection:didReceiveResponse:] called!
사람이 문제가 있었다