Skip to content

Commit

Permalink
Tests added.
Browse files Browse the repository at this point in the history
  • Loading branch information
endSly committed Dec 17, 2013
1 parent d191cca commit e60424d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions NullObjectsTests/NullObjectsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ - (void)testNullTraceable
[nullTraceable stringByAppendingString:@"test"]; // Should display log
}

- (void)testExplicitConversions
{
id null = [NONull nullClassWithOptions:@{NONullDefineExplicitConversions: @YES}];

XCTAssertEqual([null intValue], 0, @"Explicit conversions intValue should return 0.");
XCTAssertEqual([null integerValue], 0, @"Explicit conversions integerValue should return 0.");
XCTAssertEqual([null boolValue], NO, @"Explicit conversions boolValue should return NO.");
XCTAssertEqualObjects([null stringValue], @"", @"Explicit conversions stringValue should return empty string.");
}

- (void)testNSNullActAsNullObject
{
[NSNull actAsNullObject];
Expand Down

0 comments on commit e60424d

Please sign in to comment.