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

elementsOf

infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.elementsOf(expectedIterable: Iterable<Any>): 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 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
The Expect for which the assertion was built to support a fluent API.

Since
0.10.0

@JvmName("elementsOfIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterable: Iterable<Any>): 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 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
The Expect for which the assertion was built to support a fluent API.

Since
0.10.0