Skip to content

Commit

Permalink
Fixed Broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasiturbide committed Apr 25, 2014
1 parent 3570c0b commit 3a1935c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions BButtonDemoTests/BButtonDemoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,8 @@ - (void)testButtonClassInitMethods

- (void)testFontAwesome
{
NSArray *allIcons = [NSString fa_allFontAwesomeStrings];
XCTAssertNotNil(allIcons, @"Array should not be nil");
XCTAssert([allIcons count] != 0, @"Array should not be empty");

NSString *icon = [NSString fa_stringFromFontAwesomeStrings:allIcons
forIcon:FAIconWarningSign];
NSString *icon = [NSString fa_stringFromFontAwesomeForIcon:FAIconWarningSign];
XCTAssertNotNil(icon, @"Icon should not be nil");
XCTAssert([allIcons containsObject:icon], @"Icon should be contained in icon list");
XCTAssertEqual([allIcons indexOfObject:icon], FAIconWarningSign, @"Array index should equal FAIcon ENUM");



NSString *btnTitle = @"Button Title";
FAIcon i = FAIconVolumeDown;
Expand All @@ -110,17 +101,15 @@ - (void)testFontAwesome
[btn addAwesomeIcon:i beforeTitle:NO];
XCTAssertEqual([btn.titleLabel.text length], [btnTitle length] + 2, @"Button title length should be 2 characters longer after adding icon");

icon = [NSString fa_stringFromFontAwesomeStrings:allIcons forIcon:i];
icon = [NSString fa_stringFromFontAwesomeForIcon:i];
NSString *btnIcon = [btn.titleLabel.text substringFromIndex:[btn.titleLabel.text length] - 1];
XCTAssert([btnIcon isEqualToString:icon], @"Last character in button title should equal FA icon");



i = FAIconTerminal;
[btn addAwesomeIcon:i beforeTitle:YES];
XCTAssertEqual([btn.titleLabel.text length], [btnTitle length] + 4, @"Button title length should be 4 characters longer after adding 2 icons");

icon = [NSString fa_stringFromFontAwesomeStrings:allIcons forIcon:i];
icon = [NSString fa_stringFromFontAwesomeForIcon:i];
btnIcon = [btn.titleLabel.text substringToIndex:1];
XCTAssert([btnIcon isEqualToString:icon], @"First character in button title should equal FA icon");
}
Expand Down

0 comments on commit 3a1935c

Please sign in to comment.