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

elementsOf

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

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

Delegates to the values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray()) (see the 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

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

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

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 the values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray()) (see the 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

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.elementsOf(expectedIterable: Iterable<CharSequenceOrNumberOrChar>): Expect<T>

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

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

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for Any) for your convenience, so that you can mix String and Int for instance.

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

Parameters

expectedIterable - The Iterable whose elements are expected to be contained within the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

IllegalArgumentException -

in case expectedIterable is not a CharSequence, Number or Char or the given expectedIterable does not have elements (is empty).

TODO remove with 1.0.0

Return
An Expect for the current subject of the assertion.

Since
0.12.0

@JvmName("elementsOfIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterable: Iterable<CharSequenceOrNumberOrChar>): Expect<T>
@JvmName("elementsOfIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterable: Iterable<CharSequenceOrNumberOrChar>): Expect<T>

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

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

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for Any) for your convenience, so that you can mix String and Int for instance.

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

Parameters

expectedIterable - The Iterable whose elements are expected to be contained within the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

IllegalArgumentException -

in case expectedIterable is not a CharSequence, Number or Char or the given expectedIterable does not have elements (is empty).

TODO remove with 1.0.0

Return
An Expect for the current subject of the assertion.

Since
0.12.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched within the Iterable.

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

Parameters

expectedIterable - The Iterable whose elements are expected to be contained within this Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

IllegalArgumentException -

in case the given expectedIterable does not have elements (is empty).

TODO remove with 1.0.0

Return
An Expect for the current subject of the assertion.

Since
0.12.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched within the Iterable.

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 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 Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements in expectedIterable need to be contained in Iterable where it does not matter in which order but only as many entries should be returned by the Iterable as values defined.

Delegates to values.

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

expectedIterable - The Iterable whose elements are expected to be contained within this Iterable

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

IllegalArgumentException -

in case the given expectedIterable does not have elements (is empty).

TODO remove with 1.0.0

Return
An Expect for the current subject of the assertion.

Since
0.12.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements in expectedIterableLike need to be contained in Iterable where it does not matter in which order but only as many entries should be returned by the Iterable as values defined.

Delegates to values.

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.

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 Iterable

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched within the Iterable (if given) in the specified order.

Delegates to values.

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

expectedIterable - The Iterable whose elements are expected to be contained within this Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

IllegalArgumentException - in case the given expectedIterable does not have elements (is empty).

Return
An Expect for the current subject of the assertion.

Since
0.12.0 TODO remove with 1.0.0

inline infix fun <reified E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.elementsOf(expectedIterableLike: IterableLike): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched within the Iterable (if given) 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 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 Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

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

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched within the IterableLike.

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 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

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

Since
0.13.0

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

Finishes the specification of the sophisticated contains assertion where all elements in expectedIterableLike need to be contained in IterableLike where it does not matter in which order but only as many entries should be returned by the IterableLike as values defined.

Delegates to values.

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.

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

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

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

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

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterableLike shall be searched within the IterableLike (if given) 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 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

AssertionError - Might throw an AssertionError if the assertion made is not correct.

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 current subject of the assertion.

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