Module org.testfx
Package org.testfx.assertions.api
Class AbstractComboBoxAssert<SELF extends AbstractComboBoxAssert<SELF,T>,T>
- 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.AbstractComboBoxAssert<SELF,T>
-
- 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:
ComboBoxAssert
public class AbstractComboBoxAssert<SELF extends AbstractComboBoxAssert<SELF,T>,T> extends AbstractNodeAssert<SELF>
Assertion methods forComboBox
type.To create an instance of this class, invoke
.Assertions.assertThat(ComboBox)
Example
The following code:
will assert thatComboBox<String> fruits = new ComboBox<>(); fruits.getItems().addAll("Apple", "Banana", "Cherry"); assertThat(fruits).containsExactlyItemsInOrder("Apple", "Banana", "Cherry");
fruits
contains exactly (only) theString
's "Apple", "Banana", and "Cherry" in order.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComboBoxAssert(javafx.scene.control.ComboBox<T> actual, Class<?> selfType)
-
Method Summary
Modifier and Type Method Description SELF
containsExactlyItems(T... items)
Verifies that the actualComboBox
contains exactly the givenitems
in any order.SELF
containsExactlyItemsInOrder(T... items)
Verifies that the actualComboBox
contains exactly the givenitems
in order.SELF
containsItems(T... items)
Verifies that the actualComboBox
contains at least the givenitems
in any order.SELF
containsItemsInOrder(T... items)
Verifies that the actualComboBox
contains at least the givenitems
in order.SELF
doesNotHaveExactlyNumItems(int amount)
Verifies that the actualComboBox
does not have exactly the givenamount
of items.SELF
doesNotHaveSelectedItem(T selection)
Verifies that the actualComboBox
does not have the givenselection
as its' selected item.SELF
hasExactlyNumItems(int amount)
Verifies that the actualComboBox
has exactly the givenamount
of items.SELF
hasSelectedItem(T selection)
Verifies that the actualComboBox
has the givenselection
as its' selected item.-
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
-
-
-
-
Method Detail
-
hasExactlyNumItems
public SELF hasExactlyNumItems(int amount)
Verifies that the actualComboBox
has exactly the givenamount
of items.- Parameters:
amount
- the given amount of items to compare the actual amount of items to- Returns:
- this assertion object
-
doesNotHaveExactlyNumItems
public SELF doesNotHaveExactlyNumItems(int amount)
Verifies that the actualComboBox
does not have exactly the givenamount
of items.- Parameters:
amount
- the given amount of items to compare the actual amount of items to- Returns:
- this assertion object
-
hasSelectedItem
public SELF hasSelectedItem(T selection)
Verifies that the actualComboBox
has the givenselection
as its' selected item.- Parameters:
selection
- the given selection to compare the actual selected item to- Returns:
- this assertion object
-
doesNotHaveSelectedItem
public SELF doesNotHaveSelectedItem(T selection)
Verifies that the actualComboBox
does not have the givenselection
as its' selected item.- Parameters:
selection
- the given selection to compare the actual selected item to- Returns:
- this assertion object
-
containsItems
public SELF containsItems(T... items)
Verifies that the actualComboBox
contains at least the givenitems
in any order.- Parameters:
items
- the given items to ensure are at least contained in theComboBox
in any order- Returns:
- this assertion object
-
containsExactlyItems
public SELF containsExactlyItems(T... items)
Verifies that the actualComboBox
contains exactly the givenitems
in any order.- Parameters:
items
- the given items to ensure are the only ones contained in theComboBox
in any order- Returns:
- this assertion object
-
containsItemsInOrder
public SELF containsItemsInOrder(T... items)
Verifies that the actualComboBox
contains at least the givenitems
in order.- Parameters:
items
- the given items to ensure are at least contained in theComboBox
in order- Returns:
- this assertion object
-
-