Module it.tidalwave.ui.test
Package it.tidalwave.ui.test
Class ItemsAssert<T extends it.tidalwave.util.As>
java.lang.Object
it.tidalwave.ui.test.ItemsAssert<T>
Assertions for items of
Composite
and Aggregate
.- Since:
- 3.0-ALPHA-3
- Author:
- Fabrizio Giudici
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe items.The type of items.protected final boolean
WhetherwithNextItemSatisfying(ThrowingConsumer)
has been already called in the current chain. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <U extends it.tidalwave.util.As>
ItemsAssert<U> Provides all children of the current object so assertions can be enforced on them.withEachItem
(org.mockito.ThrowingConsumer<T> consumer) Enumerates all children of the current object so assertions can be enforced on them.withEachItemSatisfying
(org.mockito.ThrowingConsumer<AsAssert<?>> consumer) Enumerates all children of the current object so assertions can be enforced on them.withNextItemSatisfying
(org.mockito.ThrowingConsumer<AsAssert<?>> consumer) Provides the next child of this object so assertions can be enforced on them.
-
Field Details
-
itemType
The type of items. -
items
The items. -
nextItemSatisfyingCalled
protected final boolean nextItemSatisfyingCalledWhetherwithNextItemSatisfying(ThrowingConsumer)
has been already called in the current chain.
-
-
Constructor Details
-
ItemsAssert
public ItemsAssert()
-
-
Method Details
-
of
@Nonnull protected static <U extends it.tidalwave.util.As> ItemsAssert<U> of(@Nonnull Class<U> itemType, @Nonnull List<U> items) -
withEachItem
Enumerates all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls towithNextItemSatisfying(ThrowingConsumer)
, but only before them.- Parameters:
consumer
- the consumer of children- Returns:
- an object for fluent further assertions
-
withEachItemSatisfying
@Nonnull public ItemsAssert<T> withEachItemSatisfying(@Nonnull org.mockito.ThrowingConsumer<AsAssert<?>> consumer) Enumerates all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls towithNextItemSatisfying(ThrowingConsumer)
, but only before them.- Parameters:
consumer
- the consumer of children- Returns:
- an object for fluent further assertions
-
withAll
Provides all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls towithNextItemSatisfying(ThrowingConsumer)
, but only before them.- Parameters:
consumer
- the consumer of children- Returns:
- an object for fluent further assertions
-
withNextItemSatisfying
@Nonnull public ItemsAssert<T> withNextItemSatisfying(@Nonnull org.mockito.ThrowingConsumer<AsAssert<?>> consumer) Provides the next child of this object so assertions can be enforced on them. Further chained calls of this method will provide further children.- Parameters:
consumer
- the consumer of the child- Returns:
- an object for fluent further assertions
-