Class AbstractTextFlowAssert<SELF extends AbstractTextFlowAssert<SELF>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,javafx.css.Styleable>
-
- org.testfx.assertions.api.AbstractStyleableAssert<SELF>
-
- org.testfx.assertions.api.AbstractNodeAssert<SELF>
-
- org.testfx.assertions.api.AbstractParentAssert<SELF>
-
- org.testfx.assertions.api.AbstractTextFlowAssert<SELF>
-
- All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,javafx.css.Styleable>
,org.assertj.core.api.Descriptable<SELF>
,org.assertj.core.api.ExtensionPoints<SELF,javafx.css.Styleable>
- Direct Known Subclasses:
TextFlowAssert
public class AbstractTextFlowAssert<SELF extends AbstractTextFlowAssert<SELF>> extends AbstractParentAssert<SELF>
Base class for allTextFlow
assertions.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTextFlowAssert(javafx.scene.text.TextFlow actual, Class<?> selfType)
-
Method Summary
Modifier and Type Method Description SELF
doesNotHaveColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
does not have the givencoloredTextMarkup
.SELF
doesNotHaveExactlyColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
does not have exactly the givencoloredTextMarkup
.SELF
doesNotHaveText(String text)
Verifies that the actualTextFlow
does not have exactly the giventext
(the result of combining all of its text-based children's text together).SELF
hasColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
has the givencoloredTextMarkup
.SELF
hasExactlyColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
has exactly the givencoloredTextMarkup
.SELF
hasText(String text)
Verifies that the actualTextFlow
has exactly the giventext
(the result of combining all of its text-based children's text together).-
Methods inherited from class org.testfx.assertions.api.AbstractParentAssert
doesNotHaveExactlyNumChildren, hasAnyChild, hasExactlyNumChildren, hasNoChildren
-
Methods inherited from class org.testfx.assertions.api.AbstractNodeAssert
doesNotHaveChild, hasChild, hasExactlyChildren, isDisabled, isEnabled, isFocused, isInvisible, isNotFocused, isVisible
-
Methods inherited from class org.testfx.assertions.api.AbstractStyleableAssert
doesNotHaveId, doesNotHaveStyle, doesNotHaveStyleableParent, doesNotHaveTypeSelector, hasId, hasStyle, hasStyleableParent, hasTypeSelector
-
Methods inherited from class org.assertj.core.api.AbstractAssert
as, as, asInstanceOf, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Constructor Detail
-
AbstractTextFlowAssert
protected AbstractTextFlowAssert(javafx.scene.text.TextFlow actual, Class<?> selfType)
-
-
Method Detail
-
hasText
public SELF hasText(String text)
Verifies that the actualTextFlow
has exactly the giventext
(the result of combining all of its text-based children's text together).- Parameters:
text
- the given text to compare the actual text to- Returns:
- this assertion object
-
doesNotHaveText
public SELF doesNotHaveText(String text)
Verifies that the actualTextFlow
does not have exactly the giventext
(the result of combining all of its text-based children's text together).- Parameters:
text
- the given text to compare the actual text to- Returns:
- this assertion object
-
hasColoredText
public SELF hasColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
has the givencoloredTextMarkup
. The color is matched by using the closest named color, as described below.Colors are specified using the following markup:
<COLOR>text</COLOR>
Where COLOR is one of JavaFX's named colors.
Here is an example for verifying that a TextFlow contains the text "hello" and that the named color that has the closest value to the color of the text is Colors.RED:
Text text = new Text("hello"); text.setFill(Colors.RED); TextFlow textFlow = new TextFlow(text); assertThat(textFlow).hasColoredText("<RED>hello</RED>");
- Parameters:
coloredTextMarkup
- the given colored text markup to compare the actual colored text to- Returns:
- this assertion object
- See Also:
- Named Colors
-
doesNotHaveColoredText
public SELF doesNotHaveColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
does not have the givencoloredTextMarkup
. The color is matched by using the closest named color, as described below.Colors are specified using the following markup:
<COLOR>text</COLOR>
Where COLOR is one of JavaFX's named colors.
Here is an example for verifying that a TextFlow does not contain the text "hello" with any color that has the closest named color Colors.RED:
Text text = new Text("hello"); text.setFill(Colors.BLUE); TextFlow textFlow = new TextFlow(text); assertThat(textFlow).doesNotHaveColoredText("<RED>hello</RED>");
- Parameters:
coloredTextMarkup
- the given colored text markup to compare the actual colored text to- Returns:
- this assertion object
- See Also:
- Named Colors
-
hasExactlyColoredText
public SELF hasExactlyColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
has exactly the givencoloredTextMarkup
. The color is matched in an exact way, as described below.Colors are specified using the following markup:
<COLOR>text</COLOR>
Where COLOR is one of JavaFX's named colors.
Here is an example for verifying that a TextFlow contains the text "hello" and that the color of the text is exactly Colors.BLUE (that is, it has an RGB value of (0, 0, 255)).
Text text = new Text("hello"); text.setFill(Colors.BLUE); // or: text.setFill(Colors.rgb(0, 0, 255)); TextFlow textFlow = new TextFlow(text); assertThat(textFlow).hasExactlyColoredText("
hello ");- Parameters:
coloredTextMarkup
- the given colored text markup to compare the actual colored text to- Returns:
- this assertion object
- See Also:
- Named Colors
-
doesNotHaveExactlyColoredText
public SELF doesNotHaveExactlyColoredText(String coloredTextMarkup)
Verifies that the actualTextFlow
does not have exactly the givencoloredTextMarkup
. The color is matched in an exact way, as described below.Colors are specified using the following markup:
<COLOR>text</COLOR>
Where COLOR is one of JavaFX's named colors.
Here is an example for verifying that a TextFlow does not contain the text "hello" and that the color of the text is not exactly Colors.BLUE (that is, it does not have an RGB value of (0, 0, 255)).
Text text = new Text("hello"); text.setFill(Colors.rgb(0, 0, 254)); TextFlow textFlow = new TextFlow(text); assertThat(textFlow).doesNotHaveExactlyColoredText("
hello ");- Parameters:
coloredTextMarkup
- the given colored text markup to compare the actual colored text to- Returns:
- this assertion object
- See Also:
- Named Colors
-
-