doc / ch.tutteli.atrium.api.fluent.en_GB / elementsOf

elementsOf

fun <T : CharSequence> CharSequenceContains.CheckerStep<T, NoOpSearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched, using a non disjoint search.

Delegates to values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray()) (see values for more information).

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed. This function expects IterableLike (which is a typealias for Any) to avoid cluttering the API.

By non disjoint is meant that "aa" in "aaaa" is found three times and not only two times.

Parameters

expectedIterableLike - The IterableLike whose elements are expected to be contained within the input of the search.

Exceptions

IllegalArgumentException - in case expectedIterableLike is not an Iterable, Sequence or one of the Array types or the given expectedIterableLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.13.0

@JvmName("elementsOfIgnoringCase") fun <T : CharSequence> CharSequenceContains.CheckerStep<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)
@JvmName("elementsOfIgnoringCase") fun <T : CharSequence> CharSequenceContains.EntryPointStep<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched (ignoring case), using a non disjoint search.

Delegates to values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray()) (see values for more information).

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed. This function expects IterableLike (which is a typealias for Any) to avoid cluttering the API.

By non disjoint is meant that "aa" in "aaaa" is found three times and not only two times.

Parameters

expectedIterableLike - The IterableLike whose elements are expected to be contained within the input of the search.

Exceptions

IllegalArgumentException - in case expectedIterableLike is not an Iterable, Sequence or one of the Array types or the given expectedIterableLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.13.0

inline fun <reified E, T> IterableLikeContains.CheckerStep<E, T, InAnyOrderSearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (an IterableLike) needs to contain all elements of the expectedIterableLike where it does not matter in which order they appear.

Delegates to values which also means that it does not search for unique matches (see values for more information).

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed (this can be changed via IterableLikeToIterableTransformer). This function expects IterableLike (which is a typealias for Any) to avoid cluttering the API.

Parameters

expectedIterableLike - The IterableLike whose elements are expected to be contained within this IterableLike.

Exceptions

IllegalArgumentException - in case expectedIterableLike is not an Iterable, Sequence or one of the Array types or the given expectedIterableLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.14.0 -- API existed for Iterable since 0.13.0 but not for IterableLike.

inline fun <reified E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (an IterableLike) needs to contain only and all elements of expectedIterableLike where it does not matter in which order.

Delegates to values.

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed (this can be changed via IterableLikeToIterableTransformer). This function expects IterableLike (which is a typealias for Any) to avoid cluttering the API.

Note that we might change the signature of this function with the next version which will cause a binary backward compatibility break (see #292 for more information)

Parameters

expectedIterableLike - The IterableLike whose elements are expected to be contained within this IterableLike

Exceptions

IllegalArgumentException - in case expectedIterableLike is not an Iterable, Sequence or one of the Array types or the given expectedIterableLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.14.0 -- API existed for Iterable since 0.13.0 but not for IterableLike.

inline fun <reified E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (an IterableLike) needs to contain only and all elements of expectedIterableLike in the specified order.

Delegates to values.

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed (this can be changed via IterableLikeToIterableTransformer). This function expects IterableLike (which is a typealias for Any) to avoid cluttering the API.

Note that we might change the signature of this function with the next version which will cause a binary backward compatibility break (see #292 for more information)

Parameters

expectedIterableLike - The IterableLike whose elements are expected to be contained within this IterableLike.

Exceptions

IllegalArgumentException - in case expectedIterableLike is not an Iterable, Sequence or one of the Array types or the given expectedIterableLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.14.0 -- API existed for Iterable since 0.13.0 but not for IterableLike.