XCode?μ?iOS???????
???????????? ???????[ 2014/1/8 15:35:40 ] ??????????????? iOS ???????
????3.4????? Tests ?????е? UTSAppDelegate.h ?? UTSAppDelegate.m ?????????
????3.5????? Tests ?????е? main.m ?:
#import <UIKit/UIKit.h>
#import <GHUnitIOS/GHUnitIOSAppDelegate.h>
int main(int argc?? char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc?? argv?? nil?? NSStringFromClass([GHUnitIOSAppDelegate class]));
}
}
????3.6??????????? Tests>iPhone 5.0 Simulator?????????У????????????Ч?????????????б?д?κ?????????????б?????
????4????д GHUnit ??????? Tests ???????????? GHUnitSampleTest ?? Objective C class???????????£?
GHUnitSampleTest.h
#import <GHUnitIOS/GHUnit.h>
@interface GHUnitSampleTest: GHTestCase
{
}
@end
GHUnitSampleTest.m
#import "GHUnitSampleTest.h"
@implementation GHUnitSampleTest
- (void)testStrings
{
NSString *string1 = @"a string";
GHTestLog(@"I can log to the GHUnit test console: %@"?? string1);
// Assert string1 is not NULL?? with no custom error description
GHAssertNotNULL(string1?? nil);
// Assert equal objects?? add custom error description
NSString *string2 = @"a string";
GHAssertEqualObjects(string1?? string2?? @"A custom error message. string1 should be equal to: %@."?? string2);
}
@end
?????????????У???? Run??Ч?????£?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11