我该怎么做,因为显然有很多异步方法,而且(据我所知)没有办法在单元测试中检查它们。
例如:
- (void) testSomeTest {
// things
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(helperTestSomeTest:)
name:connectionFinished
object:nil];
// connect to server
}
- (void) helperTestSomeTest:(NSNotification)notification {
STAssertWhatever(whathever, nil); // not working
}