Module org.testfx

Class AbstractTextAssert<SELF extends AbstractTextAssert<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:
    TextAssert

    public class AbstractTextAssert<SELF extends AbstractTextAssert<SELF>>
    extends AbstractNodeAssert<SELF>
    Base class for all Text assertions.
    • Field Summary

      • Fields inherited from class org.assertj.core.api.AbstractAssert

        actual, info, myself, throwUnsupportedExceptionOnEquals
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractTextAssert​(javafx.scene.text.Text actual, Class<?> selfType)  
    • Method Summary

      Modifier and Type Method Description
      SELF doesNotHaveFont​(javafx.scene.text.Font font)
      Verifies that the actual Text does not have the given font.
      SELF doesNotHaveFontSmoothingType​(javafx.scene.text.FontSmoothingType smoothingType)
      Verifies that the actual Text does not have the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
      SELF doesNotHaveStrikethrough()
      Verifies that the actual Text does not have strikethrough (that is, should be drawn with a line through it).
      SELF doesNotHaveText​(String text)
      Verifies that the actual Text does not have exactly the given text.
      SELF doesNotHaveText​(org.hamcrest.Matcher<String> matcher)
      Verifies that the actual Text is not matched by the given matcher.
      SELF hasFont​(javafx.scene.text.Font font)
      Verifies that the actual Text has the given font.
      SELF hasFontSmoothingType​(javafx.scene.text.FontSmoothingType smoothingType)
      Verifies that the actual Text has the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
      SELF hasStrikethrough()
      Verifies that the actual Text has strikethrough (that is, should be drawn with a line through it).
      SELF hasText​(String text)
      Verifies that the actual Text has exactly the given text.
      SELF hasText​(org.hamcrest.Matcher<String> matcher)
      Verifies that the actual Text is matched by the given matcher.
      SELF isNotUnderlined()
      Verifies that the actual Text is not underlined (that is, should be drawn with a line below it).
      SELF isUnderlined()
      Verifies that the actual Text is underlined (that is, should be drawn with a line below it).
      • 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

      • AbstractTextAssert

        protected AbstractTextAssert​(javafx.scene.text.Text actual,
                                     Class<?> selfType)
    • Method Detail

      • hasText

        public SELF hasText​(String text)
        Verifies that the actual Text has exactly the given text.
        Parameters:
        text - the given text to compare the actual text to
        Returns:
        this assertion object
      • doesNotHaveText

        public SELF doesNotHaveText​(String text)
        Verifies that the actual Text does not have exactly the given text.
        Parameters:
        text - the given text to compare the actual text to
        Returns:
        this assertion object
      • hasText

        public SELF hasText​(org.hamcrest.Matcher<String> matcher)
        Verifies that the actual Text is matched by the given matcher.
        Parameters:
        matcher - the String matcher to test the actual text with
        Returns:
        this assertion object
      • doesNotHaveText

        public SELF doesNotHaveText​(org.hamcrest.Matcher<String> matcher)
        Verifies that the actual Text is not matched by the given matcher.
        Parameters:
        matcher - the String matcher to test the actual text with
        Returns:
        this assertion object
      • hasFont

        public SELF hasFont​(javafx.scene.text.Font font)
        Verifies that the actual Text has the given font.
        Parameters:
        font - the given font to compare the actual font of the text to
        Returns:
        this assertion object
      • doesNotHaveFont

        public SELF doesNotHaveFont​(javafx.scene.text.Font font)
        Verifies that the actual Text does not have the given font.
        Parameters:
        font - the given font to compare the actual font of the text to
        Returns:
        this assertion object
      • hasFontSmoothingType

        public SELF hasFontSmoothingType​(javafx.scene.text.FontSmoothingType smoothingType)
        Verifies that the actual Text has the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
        Parameters:
        smoothingType - the given font smoothing type to compare the actual font smoothing type of the text to
        Returns:
        this assertion object
      • doesNotHaveFontSmoothingType

        public SELF doesNotHaveFontSmoothingType​(javafx.scene.text.FontSmoothingType smoothingType)
        Verifies that the actual Text does not have the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
        Parameters:
        smoothingType - the given font smoothing type to compare the actual font smoothing type of the text to
        Returns:
        this assertion object
      • hasStrikethrough

        public SELF hasStrikethrough()
        Verifies that the actual Text has strikethrough (that is, should be drawn with a line through it).
        Returns:
        this assertion object
      • doesNotHaveStrikethrough

        public SELF doesNotHaveStrikethrough()
        Verifies that the actual Text does not have strikethrough (that is, should be drawn with a line through it).
        Returns:
        this assertion object
      • isUnderlined

        public SELF isUnderlined()
        Verifies that the actual Text is underlined (that is, should be drawn with a line below it).
        Returns:
        this assertion object
      • isNotUnderlined

        public SELF isNotUnderlined()
        Verifies that the actual Text is not underlined (that is, should be drawn with a line below it).
        Returns:
        this assertion object