Skip to content

Commit

Permalink
增加测试覆盖率
Browse files Browse the repository at this point in the history
  • Loading branch information
Minster committed Jan 22, 2018
1 parent 6067e57 commit 8ff7a8b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions YYModelTests/YYTestAutoTypeConvert.m
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,20 @@ - (void)testArrayAndDic {
array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonObjectFromString:json]];
XCTAssertTrue(array.count == 3);
XCTAssertTrue([array.firstObject isKindOfClass:[YYTestAutoTypeModel class]]);


json = @"[[[{\"v\":1},{\"v\":2},{\"v\":3}]]]";
NSArray *array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:json];
XCTAssertTrue(array.count == 1);
XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]);

array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonDataFromString:json]];
XCTAssertTrue(array.count == 1);
XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]);

array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonObjectFromString:json]];
XCTAssertTrue(array.count == 1);
XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]);


json = @"{\"a\":{\"v\":1},\"b\":{\"v\":2},\"c\":{\"v\":3}}";
Expand Down

0 comments on commit 8ff7a8b

Please sign in to comment.