Package org.testfx.assertions.api
Class AbstractColorAssert<SELF extends AbstractColorAssert<SELF>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,javafx.scene.paint.Color>
-
- org.testfx.assertions.api.AbstractColorAssert<SELF>
-
- All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,javafx.scene.paint.Color>,org.assertj.core.api.Descriptable<SELF>,org.assertj.core.api.ExtensionPoints<SELF,javafx.scene.paint.Color>
- Direct Known Subclasses:
ColorAssert
public class AbstractColorAssert<SELF extends AbstractColorAssert<SELF>> extends org.assertj.core.api.AbstractAssert<SELF,javafx.scene.paint.Color>Base class for allColorassertions.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractColorAssert(javafx.scene.paint.Color color, java.lang.Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELFdoesNotHaveClosestNamedColor(java.lang.String namedColor)Verifies that the actualColordoes not have the givennamedColoras their closest named color.SELFdoesNotHaveClosestNamedColor(javafx.scene.paint.Color namedColor)Verifies that the actualColordoes not have the givennamedColoras their closest named color.SELFhasClosestNamedColor(java.lang.String namedColor)Verifies that the actualColorhas the givennamedColoras their closest named color.SELFhasClosestNamedColor(javafx.scene.paint.Color namedColor)Verifies that the actualColorhas the givennamedColoras their closest named color.SELFisColor(java.lang.String namedColor)Verifies that the actualColoris exactly equal to the given named color.SELFisColor(javafx.scene.paint.Color color)Verifies that the actualColoris exactly equal to the givencolor.SELFisColor(javafx.scene.paint.Color color, ColorMatcher colorMatcher)Verifies that the actualColoris matched by the givencolorwith respect to the givencolorMatcher.SELFisNotColor(java.lang.String namedColor)Verifies that the actualColoris not exactly equal to the givennamedColor.SELFisNotColor(javafx.scene.paint.Color color)Verifies that the actualColoris not exactly equal to the givencolor.SELFisNotColor(javafx.scene.paint.Color color, ColorMatcher colorMatcher)Verifies that the actualColoris not matched by the givencolorwith respect to the givencolorMatcher.-
Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Method Detail
-
isColor
public SELF isColor(javafx.scene.paint.Color color)
Verifies that the actualColoris exactly equal to the givencolor.- Parameters:
color- the given color to compare the actual color to- Returns:
- this assertion object
-
isNotColor
public SELF isNotColor(javafx.scene.paint.Color color)
Verifies that the actualColoris not exactly equal to the givencolor.- Parameters:
color- the given color to compare the actual color to- Returns:
- this assertion object
-
isColor
public SELF isColor(javafx.scene.paint.Color color, ColorMatcher colorMatcher)
Verifies that the actualColoris matched by the givencolorwith respect to the givencolorMatcher.For example, to match colors using a custom matcher that considers two colors equal if they have the same red components:
assertThat(Color.rgb(0.3, 0.2, 0.1)).isColor(Color.rgb(0.3, 0.8, 0.7), (c1, c2) -> c1.getRed() == c2.getRed());- Parameters:
color- the given color to compare the actual color tocolorMatcher- the color matcher to use for comparison- Returns:
- this assertion object
-
isNotColor
public SELF isNotColor(javafx.scene.paint.Color color, ColorMatcher colorMatcher)
Verifies that the actualColoris not matched by the givencolorwith respect to the givencolorMatcher.- Parameters:
color- the given color to compare the actual color tocolorMatcher- the color matcher to use for comparison- Returns:
- this assertion object
-
isColor
public SELF isColor(java.lang.String namedColor)
Verifies that the actualColoris exactly equal to the given named color.- Parameters:
namedColor- the given named color to compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given namedColoris not a JavaFX named color- See Also:
- JavaFX Named Colors
-
isNotColor
public SELF isNotColor(java.lang.String namedColor)
Verifies that the actualColoris not exactly equal to the givennamedColor.- Parameters:
namedColor- the given named color to compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given namedColoris not a JavaFX named color- See Also:
- JavaFX Named Colors
-
hasClosestNamedColor
public SELF hasClosestNamedColor(javafx.scene.paint.Color namedColor)
Verifies that the actualColorhas the givennamedColoras their closest named color. ThenamedColoris not case sensitive.- Parameters:
namedColor- the given named color to compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given namedColoris not a JavaFX named color- See Also:
- JavaFX Named Colors
-
doesNotHaveClosestNamedColor
public SELF doesNotHaveClosestNamedColor(javafx.scene.paint.Color namedColor)
Verifies that the actualColordoes not have the givennamedColoras their closest named color. ThenamedColoris not case sensitive.- Parameters:
namedColor- the given namedColorto compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given namedColoris not a JavaFX named color- See Also:
- JavaFX Named Colors
-
hasClosestNamedColor
public SELF hasClosestNamedColor(java.lang.String namedColor)
Verifies that the actualColorhas the givennamedColoras their closest named color. ThenamedColoris not case sensitive.- Parameters:
namedColor- the given named colorStringto compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given named color is not a JavaFX named color- See Also:
- JavaFX Named Colors
-
doesNotHaveClosestNamedColor
public SELF doesNotHaveClosestNamedColor(java.lang.String namedColor)
Verifies that the actualColordoes not have the givennamedColoras their closest named color. ThenamedColoris not case sensitive.- Parameters:
namedColor- the given named colorStringto compare the actual color to- Returns:
- this assertion object
- Throws:
java.lang.AssertionError- if the given named coloris not a JavaFX named color- See Also:
- JavaFX Named Colors
-
-