SELF
- the "self" type of this assertion class. Please read "Emulating
'self types' using Java Generics to simplify fluent API implementation" for more details.ELEMENT
- the type of elements of the "actual" value.EnumerableAssert<SELF,ELEMENT>
, ObjectEnumerableAssert<SELF,ELEMENT>
AbstractListAssert
, AbstractObjectArrayAssert
, AtomicReferenceArrayAssert
, ClassBasedNavigableListAssert
, FactoryBasedNavigableListAssert
, ListAssert
, ObjectArrayAssert
, SoftAssertionListAssert
public interface IndexedObjectEnumerableAssert<SELF extends IndexedObjectEnumerableAssert<SELF,ELEMENT>,ELEMENT> extends ObjectEnumerableAssert<SELF,ELEMENT>
Modifier and Type | Method | Description |
---|---|---|
SELF |
contains(ELEMENT value,
Index index) |
Verifies that the actual group contains the given object at the given index.
|
SELF |
doesNotContain(ELEMENT value,
Index index) |
Verifies that the actual group does not contain the given object at the given index.
|
hasSameSizeAs, hasSameSizeAs, hasSize, isEmpty, isNotEmpty, isNullOrEmpty, usingDefaultElementComparator, usingElementComparator
allMatch, allMatch, allSatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyOnce, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHaveDuplicates, doNotHave, endsWith, hasAtLeastOneElementOfType, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasSameElementsAs, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, isSubsetOf, isSubsetOf, startsWith
SELF contains(ELEMENT value, Index index)
Example:
List<Ring> elvesRings = newArrayList(vilya, nenya, narya);
// assertions will pass
assertThat(elvesRings).contains(vilya, atIndex(0));
assertThat(elvesRings).contains(nenya, atIndex(1));
assertThat(elvesRings).contains(narya, atIndex(2));
// assertions will fail
assertThat(elvesRings).contains(vilya, atIndex(1));
assertThat(elvesRings).contains(nenya, atIndex(2));
assertThat(elvesRings).contains(narya, atIndex(0));
value
- the object to look for.index
- the index where the object should be stored in the actual group.AssertionError
- if the actual group is null
or empty.NullPointerException
- if the given Index
is null
.IndexOutOfBoundsException
- if the value of the given Index
is equal to or greater than the size of the actual
group.AssertionError
- if the actual group does not contain the given object at the given index.SELF doesNotContain(ELEMENT value, Index index)
Example:
List<Ring> elvesRings = newArrayList(vilya, nenya, narya);
// assertions will pass
assertThat(elvesRings).contains(vilya, atIndex(1));
assertThat(elvesRings).contains(nenya, atIndex(2));
assertThat(elvesRings).contains(narya, atIndex(0));
// assertions will fail
assertThat(elvesRings).contains(vilya, atIndex(0));
assertThat(elvesRings).contains(nenya, atIndex(1));
assertThat(elvesRings).contains(narya, atIndex(2));
value
- the object to look for.index
- the index where the object should not be stored in the actual group.AssertionError
- if the actual group is null
.NullPointerException
- if the given Index
is null
.AssertionError
- if the actual group contains the given object at the given index.Copyright © 2014–2019. All rights reserved.