Using OCUnit, is there a way to test delegate protocols?
I\'m trying this, which doesn\'t work.
-(void) testSomeObjDelegate {
SomeObj obj = [[SomeO
Please, review Unit Testing Asynchronous Network Access. I think can help you. In short what it does is:
Add the following method which will take care of the synchronization between the unit test code and the asynchronous code under test:
- (BOOL)waitForCompletion:(NSTimeInterval)timeoutSecs {
NSDate *timeoutDate = [NSDate dateWithTimeIntervalSinceNow:timeoutSecs];
do {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:timeoutDate];
if([timeoutDate timeIntervalSinceNow] < 0.0)
break;
} while (!done);
return done;
}