|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
S
- the "self" type of this assertion class. Please read
"Emulating 'self types' using Java Generics to simplify fluent
API implementation" for more details.public interface ObjectEnumerableAssert<S>
Assertions methods applicable to groups of objects (e.g. arrays or collections.)
Method Summary | ||
---|---|---|
|
are(Condition<E> condition)
Verifies that each element value satisfies the given condition |
|
|
areAtLeast(int n,
Condition<E> condition)
Verifies that there is at least n elements in the actual group satisfying the given condition. |
|
|
areAtMost(int n,
Condition<E> condition)
Verifies that there is at most n elements in the actual group satisfying the given condition. |
|
|
areExactly(int n,
Condition<E> condition)
Verifies that there is exactly n elements in the actual group satisfying the given condition. |
|
|
areNot(Condition<E> condition)
Verifies that each element value not satisfies the given condition |
|
|
areNotAtLeast(int n,
Condition<E> condition)
Verifies that there is at least n elements in the actual group not satisfying the given condition. |
|
|
areNotAtMost(int n,
Condition<E> condition)
Verifies that there is at most n elements in the actual group not satisfying the given condition. |
|
|
areNotExactly(int n,
Condition<E> condition)
Verifies that there is exactly n elements in the actual group not satisfying the given condition. |
|
S |
contains(Object... values)
Verifies that the actual group contains the given values, in any order. |
|
S |
containsNull()
Verifies that the actual group contains at least a null element. |
|
S |
containsOnly(Object... values)
Verifies that the actual group contains only the given values and nothing else, in any order. |
|
S |
containsSequence(Object... sequence)
Verifies that the actual group contains the given sequence, without any other values between them. |
|
S |
doesNotContain(Object... values)
Verifies that the actual group does not contain the given values. |
|
S |
doesNotContainNull()
Verifies that the actual group does not contain null elements. |
|
S |
doesNotHaveDuplicates()
Verifies that the actual group does not contain duplicates. |
|
|
doNotHave(Condition<E> condition)
Verifies that each element value not satisfies the given condition |
|
|
doNotHaveAtLeast(int n,
Condition<E> condition)
This method is an alias areNotAtLeast(int, Condition) . |
|
|
doNotHaveAtMost(int n,
Condition<E> condition)
This method is an alias areNotAtMost(int, Condition) . |
|
|
doNotHaveExactly(int n,
Condition<E> condition)
This method is an alias areNotExactly(int, Condition) . |
|
S |
endsWith(Object... sequence)
Verifies that the actual group ends with the given sequence of objects, without any other objects between them. |
|
|
have(Condition<E> condition)
Verifies that each element value satisfies the given condition |
|
|
haveAtLeast(int n,
Condition<E> condition)
This method is an alias for areAtLeast(int, Condition) . |
|
|
haveAtMost(int n,
Condition<E> condition)
This method is an alias areAtMost(int, Condition) . |
|
|
haveExactly(int n,
Condition<E> condition)
This method is an alias areExactly(int, Condition) . |
|
S |
startsWith(Object... sequence)
Verifies that the actual group starts with the given sequence of objects, without any other objects between them. |
Methods inherited from interface org.fest.assertions.core.EnumerableAssert |
---|
hasSize, isEmpty, isNotEmpty, isNullOrEmpty |
Method Detail |
---|
S contains(Object... values)
values
- the given values.
this
assertion object.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group does not contain the given values.S containsOnly(Object... values)
values
- the given values.
this
assertion object.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group does not contain the given values, i.e. the actual group contains some
or none of the given values, or the actual group contains more values than the given ones.S containsSequence(Object... sequence)
sequence
- the sequence of objects to look for.
AssertionError
- if the actual group is null
.
AssertionError
- if the given array is null
.
AssertionError
- if the actual group does not contain the given sequence.S doesNotContain(Object... values)
values
- the given values.
this
assertion object.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group contains any of the given values.S doesNotHaveDuplicates()
this
assertion object.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group contains duplicates.S startsWith(Object... sequence)
containsSequence(Object...)
, but it also verifies that the first element in the
sequence is also first element of the actual group.
sequence
- the sequence of objects to look for.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group does not start with the given sequence of objects.S endsWith(Object... sequence)
containsSequence(Object...)
, but it also verifies that the last element in the
sequence is also last element of the actual group.
sequence
- the sequence of objects to look for.
NullPointerException
- if the given argument is null
.
IllegalArgumentException
- if the given argument is an empty array.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group does not end with the given sequence of objects.S containsNull()
this
assertion object.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group does not contain a null element.S doesNotContainNull()
this
assertion object.
AssertionError
- if the actual group is null
.
AssertionError
- if the actual group contains a null element.<E> S are(Condition<E> condition)
condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if one or more element not satisfy the given condition.<E> S areNot(Condition<E> condition)
condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if one or more element satisfy the given condition.<E> S have(Condition<E> condition)
condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if one or more element not satisfy the given condition.<E> S doNotHave(Condition<E> condition)
condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if one or more element satisfy the given condition.<E> S areAtLeast(int n, Condition<E> condition)
n
- the minimum number of times the condition should be verified.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if an element can not be cast to E.
AssertionError
- if the number of elements satisfying the given condition is < n.<E> S areNotAtLeast(int n, Condition<E> condition)
n
- the number of times the condition should not be verified at least.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if the number of elements not satisfying the given condition is < n.<E> S areAtMost(int n, Condition<E> condition)
n
- the number of times the condition should be at most verified.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if the number of elements satisfying the given condition is > n.<E> S areNotAtMost(int n, Condition<E> condition)
n
- the number of times the condition should not be verified at most.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if the number of elements not satisfying the given condition is > n.<E> S areExactly(int n, Condition<E> condition)
n
- the exact number of times the condition should be verified.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if the number of elements satisfying the given condition is ≠ n.<E> S areNotExactly(int n, Condition<E> condition)
n
- the exact number of times the condition should not be verified.condition
- the given condition.
this
object.
NullPointerException
- if the given condition is null
.
AssertionError
- if a element cannot be cast to E.
AssertionError
- if the number of elements not satisfying the given condition is ≠ n.<E> S haveAtLeast(int n, Condition<E> condition)
areAtLeast(int, Condition)
.
<E> S doNotHaveAtLeast(int n, Condition<E> condition)
areNotAtLeast(int, Condition)
.
<E> S haveAtMost(int n, Condition<E> condition)
areAtMost(int, Condition)
.
<E> S doNotHaveAtMost(int n, Condition<E> condition)
areNotAtMost(int, Condition)
.
<E> S haveExactly(int n, Condition<E> condition)
areExactly(int, Condition)
.
<E> S doNotHaveExactly(int n, Condition<E> condition)
areNotExactly(int, Condition)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |