atrium-api-fluent-en_GB-jvm / ch.tutteli.atrium.api.fluent.en_GB / elementsOf

elementsOf

fun <T : CharSequence> <ERROR CLASS><T, <ERROR CLASS>>.elementsOf(expectedIterable: Iterable<Any>): <ERROR CLASS><T> (source)

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable 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 CharSequence, Number and Char are passed (this function expects 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).

Return
An Expect for the current subject of the assertion.

Since
0.9.0

inline fun <reified E, T : Iterable<E>> <ERROR CLASS><E, T, <ERROR CLASS>>.elementsOf(expectedIterable: Iterable<E>): <ERROR CLASS><T> (source)

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

Return
An Expect for the current subject of the assertion.

Since
0.9.0