How to test a sendAsynchronousRequest: on XCTest
问题 Sorry for the noob question, but I'm trying to test a connection, but I'm not able do verify the return of the request, because the test ends before the completion handler have a chance to execute. To ilustrate: -(void)testConnection { [[Conector sharedInstance] performAsynchronousRequestWithServerRequest:_srvRequest completionHandler:^(RequestAsynchronousStatus finishStatus, NSData *data) { if (finishStatus == RequestAsynchronousOK){ _data = data; NSLog(@"Data OK"); } }]; XCTAssertNotNil(