Adium

Changeset 22807

Show
Ignore:
Timestamp:
03/04/2008 10:41:44 AM (9 months ago)
Author:
boredzo
Message:

Added test-case methods for -stringRepresentation with semi-transparent colors. These tests pass. Refs #9341.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/UnitTests/TestColorAdditions.h

    r22796 r22807  
    9090- (void)testStringRepresentationForWhite; 
    9191- (void)testStringRepresentationForBlack; 
     92 
     93- (void)testStringRepresentationForSemiTransparentRed; 
     94- (void)testStringRepresentationForSemiTransparentYellow; 
     95- (void)testStringRepresentationForSemiTransparentGreen; 
     96- (void)testStringRepresentationForSemiTransparentCyan; 
     97- (void)testStringRepresentationForSemiTransparentBlue; 
     98- (void)testStringRepresentationForSemiTransparentMagenta; 
     99- (void)testStringRepresentationForSemiTransparentWhite; 
     100- (void)testStringRepresentationForSemiTransparentBlack; 
    92101 
    93102#pragma mark -CSSRepresentation 
  • trunk/UnitTests/TestColorAdditions.m

    r22799 r22807  
    481481} 
    482482 
     483- (void)testStringRepresentationForSemiTransparentRed 
     484{ 
     485        NSColor *color = [[NSColor redColor] colorWithAlphaComponent:0.5]; 
     486        NSString *correctString = @"255,0,0,127"; 
     487        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for red should be %@", correctString); 
     488} 
     489- (void)testStringRepresentationForSemiTransparentYellow 
     490{ 
     491        NSColor *color = [[NSColor yellowColor] colorWithAlphaComponent:0.5]; 
     492        NSString *correctString = @"255,255,0,127"; 
     493        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for yellow should be %@", correctString); 
     494} 
     495- (void)testStringRepresentationForSemiTransparentGreen 
     496{ 
     497        NSColor *color = [[NSColor greenColor] colorWithAlphaComponent:0.5]; 
     498        NSString *correctString = @"0,255,0,127"; 
     499        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for green should be %@", correctString); 
     500} 
     501- (void)testStringRepresentationForSemiTransparentCyan 
     502{ 
     503        NSColor *color = [[NSColor cyanColor] colorWithAlphaComponent:0.5]; 
     504        NSString *correctString = @"0,255,255,127"; 
     505        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for cyan should be %@", correctString); 
     506} 
     507- (void)testStringRepresentationForSemiTransparentBlue 
     508{ 
     509        NSColor *color = [[NSColor blueColor] colorWithAlphaComponent:0.5]; 
     510        NSString *correctString = @"0,0,255,127"; 
     511        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for blue should be %@", correctString); 
     512} 
     513- (void)testStringRepresentationForSemiTransparentMagenta 
     514{ 
     515        NSColor *color = [[NSColor magentaColor] colorWithAlphaComponent:0.5]; 
     516        NSString *correctString = @"255,0,255,127"; 
     517        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for magenta should be %@", correctString); 
     518} 
     519- (void)testStringRepresentationForSemiTransparentWhite 
     520{ 
     521        NSColor *color = [[NSColor whiteColor] colorWithAlphaComponent:0.5]; 
     522        NSString *correctString = @"255,255,255,127"; 
     523        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for white should be %@", correctString); 
     524} 
     525- (void)testStringRepresentationForSemiTransparentBlack 
     526{ 
     527        NSColor *color = [[NSColor blackColor] colorWithAlphaComponent:0.5]; 
     528        NSString *correctString = @"0,0,0,127"; 
     529        STAssertEqualObjects([color stringRepresentation], correctString, @"String representation for black should be %@", correctString); 
     530} 
     531 
    483532#pragma mark -CSSRepresentation 
    484533- (void)testCSSRepresentationForRed