Tag: Xcode4/UnitTest
STAssertEqualObjects(@"2010/11/12 00:00:00", actual, @"compare 1");
+ (NSString*)stringFromJSONFileNamed:(NSString *)fileName { // NSString *resource = [[NSBundle mainBundle] pathForResource:fileName ofType:@"json"]; NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *resource = [bundle pathForResource:fileName ofType:@"json"]; NSError *error; return [NSString stringWithContentsOfFile:resource encoding:NSUTF8StringEncoding error:&error];
- (void)testExample { NSString* str = [TestingHelper stringFromJSONFileNamed:@"job"]; NSLog(@"str=%@", str); //以下strを用いてテスト。 }