Unit testing using XCode:
*Testing asynchronous block of code
- (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];
}