I am using OCUnit to write unit test, i tried GHUnit but it does not suit my case.
I do want to run a application test because my code heavily relied on my ApplicationDelegate instance. But i can only figure out how to run logic test but not application test.
This is a sample testing code from template, but either my test failed (no application delegate) or no testing code run at all.
- (void) testAppDelegate {
id yourApplicationDelegate = [[UIApplication sharedApplication] delegate];
STAssertNotNil(yourApplicationDelegate, @"UIApplication failed to find the AppDelegate");
}
I found a guide from apple about how to set up the test, but it is not for Xcode 4