Package org.fest.swing.fixture
Class ColorFixture
java.lang.Object
org.fest.swing.fixture.ColorFixture
Understands state verification of
Colors.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.fest.assertions.Descriptionprivate final Color -
Constructor Summary
ConstructorsConstructorDescriptionColorFixture(Color target) Creates a newColorFixture.ColorFixture(Color target, String description) Creates a newColorFixture.ColorFixture(Color target, org.fest.assertions.Description description) Creates a newColorFixture. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns this fixture's description.requireEqualTo(Color color) Verifies that this fixture'sColoris equal to the given one.requireEqualTo(String hexValue) Verifies that this fixture'sColoris equal to the given color represented by the given hexadecimal value (e.g.requireNotEqualTo(Color color) Verifies that this fixture'sColoris not equal to the given one.requireNotEqualTo(String hexValue) Verifies that this fixture'sColoris not equal to the given color represented by the given hexadecimal value (e.g.target()Returns this fixture's color.
-
Field Details
-
target
-
description
private final org.fest.assertions.Description description
-
-
Constructor Details
-
ColorFixture
Creates a newColorFixture.- Parameters:
target- the color to manage.- Throws:
NullPointerException- iftargetisnull.
-
ColorFixture
Creates a newColorFixture.- Parameters:
target- the color to manage.description- this fixture's description.- Throws:
NullPointerException- iftargetisnull.
-
ColorFixture
Creates a newColorFixture.- Parameters:
target- the color to manage.description- this fixture's description.- Throws:
NullPointerException- iftargetisnull.
-
-
Method Details
-
requireEqualTo
Verifies that this fixture'sColoris 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 isnull.IllegalArgumentException- if the hexadecimal code is empty.NumberFormatException- if the hexadecimal code is empty.AssertionError- if this fixture'sColoris not equal to the given one.
-
requireEqualTo
Verifies that this fixture'sColoris equal to the given one.- Parameters:
color- the givenColorto compare to.- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sColoris not equal to the given one.
-
requireNotEqualTo
Verifies that this fixture'sColoris 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 isnull.IllegalArgumentException- if the hexadecimal code is empty.NumberFormatException- if the hexadecimal code is empty.AssertionError- if this fixture'sColoris equal to the given one.
-
requireNotEqualTo
Verifies that this fixture'sColoris not equal to the given one.- Parameters:
color- the givenColorto compare to.- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sColoris equal to the given one.
-
target
Returns this fixture's color.- Returns:
- this fixture's color.
-
description
Returns this fixture's description.- Returns:
- this fixture's description.
-