| | 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 | |
|---|