org.fest.swing.fixture
Class ColorFixture

java.lang.Object
  extended by org.fest.swing.fixture.ColorFixture

public class ColorFixture
extends Object

Understands state verification of Colors.

Author:
Alex Ruiz

Constructor Summary
ColorFixture(Color target)
          Creates a new ColorFixture.
ColorFixture(Color target, org.fest.assertions.Description description)
          Creates a new ColorFixture.
ColorFixture(Color target, String description)
          Creates a new ColorFixture.
 
Method Summary
 String description()
          Returns this fixture's description.
 ColorFixture requireEqualTo(Color color)
          Verifies that this fixture's Color is equal to the given one.
 ColorFixture requireEqualTo(String hexValue)
          Verifies that this fixture's Color is equal to the given color represented by the given hexadecimal value (e.g. "82A9FF".)
 ColorFixture requireNotEqualTo(Color color)
          Verifies that this fixture's Color is not equal to the given one.
 ColorFixture requireNotEqualTo(String hexValue)
          Verifies that this fixture's Color is not equal to the given color represented by the given hexadecimal value (e.g. "82A9FF".)
 Color target()
          Returns this fixture's color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorFixture

public ColorFixture(Color target)
Creates a new ColorFixture.

Parameters:
target - the color to manage.
Throws:
NullPointerException - if target is null.

ColorFixture

public ColorFixture(Color target,
                    String description)
Creates a new ColorFixture.

Parameters:
target - the color to manage.
description - this fixture's description.
Throws:
NullPointerException - if target is null.

ColorFixture

public ColorFixture(Color target,
                    org.fest.assertions.Description description)
Creates a new ColorFixture.

Parameters:
target - the color to manage.
description - this fixture's description.
Throws:
NullPointerException - if target is null.
Method Detail

requireEqualTo

public ColorFixture requireEqualTo(String hexValue)
Verifies that this fixture's Color is equal to the given color represented by the given hexadecimal value (e.g. "82A9FF".)

Parameters:
hexValue - the value representing the color to compare to.
Returns:
this fixture.
Throws:
NullPointerException - if the hexadecimal code is null.
IllegalArgumentException - if the hexadecimal code is empty.
NumberFormatException - if the hexadecimal code is empty.
AssertionError - if this fixture's Color is not equal to the given one.

requireEqualTo

public ColorFixture requireEqualTo(Color color)
Verifies that this fixture's Color is equal to the given one.

Parameters:
color - the given Color to compare to.
Returns:
this fixture.
Throws:
AssertionError - if this fixture's Color is not equal to the given one.

requireNotEqualTo

public ColorFixture requireNotEqualTo(String hexValue)
Verifies that this fixture's Color is not equal to the given color represented by the given hexadecimal value (e.g. "82A9FF".)

Parameters:
hexValue - the value representing the color to compare to.
Returns:
this fixture.
Throws:
NullPointerException - if the hexadecimal code is null.
IllegalArgumentException - if the hexadecimal code is empty.
NumberFormatException - if the hexadecimal code is empty.
AssertionError - if this fixture's Color is equal to the given one.

requireNotEqualTo

public ColorFixture requireNotEqualTo(Color color)
Verifies that this fixture's Color is not equal to the given one.

Parameters:
color - the given Color to compare to.
Returns:
this fixture.
Throws:
AssertionError - if this fixture's Color is equal to the given one.

target

public Color target()
Returns this fixture's color.

Returns:
this fixture's color.

description

public final String description()
Returns this fixture's description.

Returns:
this fixture's description.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.