forked from Cocoanetics/DTCoreText
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added starting point for unit testing
- Loading branch information
1 parent
72fb587
commit b62427d
Showing
10 changed files
with
335 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// NSAttributedStringHTMLTest.h | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import <SenTestingKit/SenTestingKit.h> | ||
#import <UIKit/UIKit.h> | ||
//#import "application_headers" as required | ||
|
||
|
||
@interface NSAttributedStringHTMLTest : SenTestCase { | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// NSAttributedStringHTMLTest.m | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import "NSAttributedStringHTMLTest.h" | ||
|
||
|
||
@implementation NSAttributedStringHTMLTest | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// NSStringHTMLTest.h | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import <SenTestingKit/SenTestingKit.h> | ||
#import <UIKit/UIKit.h> | ||
//#import "application_headers" as required | ||
|
||
|
||
@interface NSStringHTMLTest : SenTestCase { | ||
|
||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// NSStringHTMLTest.m | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import "NSStringHTMLTest.h" | ||
|
||
|
||
@implementation NSStringHTMLTest | ||
|
||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class UIColor; | ||
|
||
@interface UIColor (HTML) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// UIColorHTMLTest.h | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import <SenTestingKit/SenTestingKit.h> | ||
#import <UIKit/UIKit.h> | ||
//#import "application_headers" as required | ||
|
||
|
||
@interface UIColorHTMLTest : SenTestCase { | ||
|
||
} | ||
|
||
- (void) testValidColorWithHexString; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// UIColorHTMLTest.m | ||
// CoreTextExtensions | ||
// | ||
// Created by Claus Broch on 11/01/11. | ||
// Copyright 2011 Infinite Loop. All rights reserved. | ||
// | ||
|
||
#import "UIColorHTMLTest.h" | ||
#import "UIColor+HTML.h" | ||
|
||
@implementation UIColorHTMLTest | ||
|
||
|
||
- (void) testValidColorWithHexString | ||
{ | ||
UIColor *htmlColor; | ||
UIColor *namedColor; | ||
|
||
namedColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"000000"]; | ||
STAssertNotNil(htmlColor, @"Failed to create black color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... black is not black"); | ||
|
||
namedColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"FFFFFF"]; | ||
STAssertNotNil(htmlColor, @"Failed to create white color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... white is not white"); | ||
|
||
namedColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"FF0000"]; | ||
STAssertNotNil(htmlColor, @"Failed to create red color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... red is not red"); | ||
|
||
namedColor = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"00FF00"]; | ||
STAssertNotNil(htmlColor, @"Failed to create green color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... green is not green"); | ||
|
||
namedColor = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"0000FF"]; | ||
STAssertNotNil(htmlColor, @"Failed to create blue color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... blue is not blue"); | ||
|
||
namedColor = [UIColor colorWithRed:1.0 green:0.0 blue:1.0 alpha:1.0]; | ||
htmlColor = [UIColor colorWithHexString:@"F0F"]; | ||
STAssertNotNil(htmlColor, @"Failed to create purple color"); | ||
STAssertEqualObjects(namedColor, htmlColor, @"Hmmm... purple is not purple"); | ||
} | ||
|
||
|
||
@end |
Oops, something went wrong.