Class ColorFixture

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

public class ColorFixture extends Object
Understands state verification of Colors.
  • Field Details

    • target

      private final Color target
    • description

      private final org.fest.assertions.Description description
  • Constructor Details

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

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