atrium-api-fluent-en_GB-jvm / ch.tutteli.atrium.api.fluent.en_GB / ch.tutteli.atrium.domain.creating.iterable.contains.IterableContains.CheckerOption / values

values

fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.values(expected: E, vararg otherExpected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value as well as the otherExpected values (if given) shall be searched within the Iterable.

Notice, that it does not search for unique matches. Meaning, if the iterable is setOf('a', 'b') and expected is defined as 'a' and one otherExpected is defined as 'a' as well, then both match, even though they match the same entry. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: contains.inAnyOrder.exactly(2).values('a') instead of: contains.inAnyOrder.atLeast(1).values('a', 'a')

Parameters

expected - The object which is expected to be contained within this Iterable.

otherExpected - Additional objects which are expected to be contained within this Iterable.

Exceptions

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

Return
The Expect for which the assertion was built to support a fluent API.