T
- the Element type of the Iteratorpublic interface AssertThatIterable<T> extends AssertThatObject<Iterable<T>>
This interface is returned by the various methods
assertThatIterable
exposed by
TestSuite
.
assertion on object are also available on iterable.
Modifier and Type | Method and Description |
---|---|
default boolean |
contains(T... items)
Check that the iterable contains the items.
|
default boolean |
containsInAnyOrder(T... items)
Check that the iterable contains the items in any order.
|
default boolean |
containsInAnyOrderMatching(Matcher<? super T>... items)
Check that the iterable contains the items in any order.
|
default boolean |
containsMatching(Matcher<? super T>... items)
Check that the iterable contains the items.
|
default boolean |
hasNotSize(int size)
Check the size is not the one passed.
|
default boolean |
hasSize(int size)
Check the size of the iterable.
|
default boolean hasSize(int size)
For instance :
assertThatIterable(myCollection).hasSize(3);
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. size
- the expected size.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.default boolean hasNotSize(int size)
For instance :
assertThatIterable(myCollection).hasNotSize(4);
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. size
- the not expected size.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.The documentation of the fastFail
attribute of the @Test
annotation, regarding the action
done by this assertion.
default boolean contains(T... items)
For instance :
assertThatIterable(myList).contains(1, 3, 5);
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. items
- the expected items.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.The documentation of the fastFail
attribute of the @Test
annotation, regarding the action
done by this assertion.
default boolean containsMatching(Matcher<? super T>... items)
For instance
assertThatIterable(myList).containsMatching(equalTo(1), equalTo(3), equalTo(5));
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. items
- the matcher for each item.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.The documentation of the fastFail
attribute of the @Test
annotation, regarding the action
done by this assertion.
default boolean containsInAnyOrder(T... items)
For instance :
assertThatIterable(myCollection).containsInAnyOrder(5, 3, 1);
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. items
- the expected items.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.The documentation of the fastFail
attribute of the @Test
annotation, regarding the action
done by this assertion.
default boolean containsInAnyOrderMatching(Matcher<? super T>... items)
For instance :
assertThatIterable(myCollection).containsInAnyOrderMatching(equalTo(5), equalTo(3), equalTo(1));
fastFail
attribute of @Test
annotation is used, the assertion may not be lost, in case the thread use
an assertion method from the test object instance. items
- the matcher for each item.Test.fastFail()
: If true
, then
fail the test, else, return false and the test will be failed
later.The documentation of the fastFail
attribute of the @Test
annotation, regarding the action
done by this assertion.
Copyright © 2015 Powerunit. All rights reserved.