そして、どうすればそれを行うことができますか。明らかに非同期メソッドがたくさんあり、単体テストでそれらをチェックする方法(私が知っている)がないからです。
例えば:
- (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
}