Testing asynchronous block of code

suggest change
- (void)testDoSomethingThatTakesSomeTime{
XCTestExpectation *completionExpectation = [self expectationWithDescription:@"Long method"];
[self.someObject doSomethingThatTakesSomeTimesWithCompletionBlock:^(NSString *result) {
    XCTAssertEqualObjects(@"result", result, @"Result was not correct!");
    [completionExpectation fulfill];
}];
[self waitForExpectationsWithTimeout:5.0 handler:nil];
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Unit testing using XCode:
*Testing asynchronous block of code

Table Of Contents