アプリデリゲートのテストケースを設計して、インスタンスをインスタンス化し、そこからメソッドを呼び出して出力をテストすることをお勧めします。
次のような構造を考えてみましょう。
@interface FizzBuzzObjCStudyTest : GHTestCase {
ObjCStudyAppDelegate *appDelegate;
}
@end
@implementation FizzBuzzObjCStudyTest
-(void)setUp
{
appDelegate = [[ObjCStudyAppDelegate alloc] init];
}
-(void)tearDown
{
[appDelegate release];
}
-(void) testAppDelegate
{
GHAssertNotNil(appDelegate, @"Cannot find the application delegate", nil);
// test other methods of ObjCStudyAppDelegate here, or make more test methods.
}
@end
GHUnitフレームワークは、CLIバージョンでUIApplicationDelegateを作成するUIフレームワークをバイパスします。実際、GUIバージョンのGHUnitは、GHUnitIPhoneAppDelegateと呼ばれる独自のUIApplicationDelegateを実際にインスタンス化しています。
GHUnitIOSMain.mからのスニペットは、GUIバージョン用に独自のアプリデリゲートを設定する方法を示しています。
// If GHUNIT_CLI is set we are using the command line interface and run the tests
// Otherwise load the GUI app
if (getenv("GHUNIT_CLI")) {
retVal = [GHTestRunner run];
} else {
retVal = UIApplicationMain(argc, argv, nil, @"GHUnitIPhoneAppDelegate");
}