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