Authored by 周蓉君

更新Factory的测试样例。Review by 阿瑟。

... ... @@ -11,7 +11,10 @@
#import "OCMock.h"
#import "YHDataFactory.h"
@interface YHDataFactoryTests : XCTestCase
@interface YHDataFactoryTests : XCTestCase {
@private
YHDataFactory *factory;
}
@end
... ... @@ -20,16 +23,22 @@
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
NSLog(@"%@ setUp", self.name);
factory = [[YHDataFactory alloc] init];
XCTAssertNotNil(factory, @"Cannot create YHDataFactory instance.");
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
NSLog(@"%@ tearDown", self.name);
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
- (void)testJsonDictionaryNil {
NSLog(@"%@ start", self.name);
YHAnalyItemData *data = [factory makeItemData];
XCTAssertNil(data, @"YHDataFactory makeItemData must be nil.");
NSLog(@"%@ end", self.name);
}
@end
... ...
... ... @@ -11,7 +11,10 @@
#import "OCMock.h"
#import "YHDeviceFactory.h"
@interface YHDeviceFactoryTests : XCTestCase
@interface YHDeviceFactoryTests : XCTestCase {
@private
YHDeviceFactory *factory;
}
@end
... ... @@ -20,16 +23,22 @@
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
NSLog(@"%@ setUp", self.name);
factory = [[YHDeviceFactory alloc] init];
XCTAssertNotNil(factory, @"Cannot create YHDeviceFactory instance.");
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
NSLog(@"%@ tearDown", self.name);
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
- (void)testJsonDictionaryNotNil {
NSLog(@"%@ start", self.name);
YHAnalyItemData *data = [factory makeItemData];
XCTAssertNotNil(data, @"YHDeviceFactory makeItemData can't be nil.");
NSLog(@"%@ end", self.name);
}
@end
... ...
... ... @@ -11,7 +11,10 @@
#import "OCMock.h"
#import "YHErrorFactory.h"
@interface YHErrorFactoryTests : XCTestCase
@interface YHErrorFactoryTests : XCTestCase {
@private
YHErrorFactory *factory;
}
@end
... ... @@ -20,16 +23,22 @@
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
NSLog(@"%@ setUp", self.name);
factory = [[YHErrorFactory alloc] init];
XCTAssertNotNil(factory, @"Cannot create YHErrorFactory instance.");
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
NSLog(@"%@ tearDown", self.name);
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
- (void)testJsonDictionaryNotNil {
NSLog(@"%@ start", self.name);
YHAnalyItemData *data = [factory makeItemData];
XCTAssertNotNil(data, @"YHErrorFactory makeItemData can't be nil.");
NSLog(@"%@ end", self.name);
}
@end
... ...
... ... @@ -11,7 +11,10 @@
#import "OCMock.h"
#import "YHEventFactory.h"
@interface YHEventFactoryTests : XCTestCase
@interface YHEventFactoryTests : XCTestCase {
@private
YHEventFactory *factory;
}
@end
... ... @@ -20,16 +23,22 @@
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
NSLog(@"%@ setUp", self.name);
factory = [[YHEventFactory alloc] init];
XCTAssertNotNil(factory, @"Cannot create YHEventFactory instance.");
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
NSLog(@"%@ tearDown", self.name);
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
- (void)testJsonDictionaryNotNil {
NSLog(@"%@ start", self.name);
YHAnalyItemData *data = [factory makeItemData];
XCTAssertNotNil(data, @"YHEventFactory makeItemData can't be nil.");
NSLog(@"%@ end", self.name);
}
@end
... ...
... ... @@ -11,7 +11,10 @@
#import "OCMock.h"
#import "YHStatusFactory.h"
@interface YHStatusFactoryTests : XCTestCase
@interface YHStatusFactoryTests : XCTestCase {
@private
YHStatusFactory *factory;
}
@end
... ... @@ -20,16 +23,22 @@
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
NSLog(@"%@ setUp", self.name);
factory = [[YHStatusFactory alloc] init];
XCTAssertNotNil(factory, @"Cannot create YHStatusFactory instance.");
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
NSLog(@"%@ tearDown", self.name);
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
- (void)testJsonDictionaryNotNil {
NSLog(@"%@ start", self.name);
YHAnalyItemData *data = [factory makeItemData];
XCTAssertNotNil(data, @"YHStatusFactory makeItemData can't be nil.");
NSLog(@"%@ end", self.name);
}
@end
... ...