public class ComboBoxMatchers
extends java.lang.Object
ComboBox controls.
ComboBox<String> fruits = new ComboBox<>();
fruits.getItems().addAll("Apple", "Banana", "Cherry");
assertThat(fruits, ComboBoxMatchers.containsExactlyItemsInOrder("Apple", "Banana", "Cherry"));
will verify that fruits contains exactly (only) the String's
"Apple", "Banana", and "Cherry" in order.| Modifier and Type | Method and Description |
|---|---|
static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
containsExactlyItems(T... items)
Creates a matcher that matches all
ComboBoxes that only have all of the given items,
regardless of the order of their appearance. |
static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
containsExactlyItemsInOrder(T... items)
Creates a matcher that matches all
ComboBoxes that only have all of the given items in
the exact order they are given. |
static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
containsItems(T... items)
Creates a matcher that matches all
ComboBoxes that have all of the given items, regardless
of whether it also contains other items and regardless of their order of appearance. |
static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
containsItemsInOrder(T... items)
Creates a matcher that matches all
ComboBoxes that have all of the given items in
the exact order they appear, regardless of whether it also contains other items before or after this
exact sequence. |
static org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
hasItems(int amount)
Creates a matcher that matches all
ComboBoxes that have exactly amount items. |
static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> |
hasSelectedItem(T selection)
Creates a matcher that matches all
ComboBoxes that have given selection as
its selected item. |
public static org.hamcrest.Matcher<javafx.scene.control.ComboBox> hasItems(int amount)
ComboBoxes that have exactly amount items.amount - the number of items the matched ComboBox's should havepublic static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> hasSelectedItem(T selection)
ComboBoxes that have given selection as
its selected item.selection - the selected item the matched ComboBox's should havepublic static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> containsItems(T... items)
ComboBoxes that have all of the given items, regardless
of whether it also contains other items and regardless of their order of appearance.items - the items the matched ComboBox's should havepublic static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> containsExactlyItems(T... items)
ComboBoxes that only have all of the given items,
regardless of the order of their appearance.items - the only items the matched ComboBox's should havepublic static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> containsItemsInOrder(T... items)
ComboBoxes that have all of the given items in
the exact order they appear, regardless of whether it also contains other items before or after this
exact sequence.items - the items the matched ComboBox's should have in the same orderpublic static <T> org.hamcrest.Matcher<javafx.scene.control.ComboBox> containsExactlyItemsInOrder(T... items)
ComboBoxes that only have all of the given items in
the exact order they are given.items - the only items the matched ComboBox's should have in the same order