doc / ch.tutteli.atrium.api.cc.de_CH / enthaeltNullableWerte

enthaeltNullableWerte

fun <E, T : Iterable<E>> Assert<T>.enthaeltNullableWerte(expectedOrNull: E, vararg otherExpectedOrNulls: E): AssertionPlant<T> (source)

Makes the assertion that AssertionPlant.subject (which has a nullable entry type) contains the expected nullable value and the other expected nullable values (if given).

It is a shortcut for enthaelt.inBeliebigerReihenfolge.zumindest(1).nullableWerte(expectedOrNull, *otherExpectedOrNulls)

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

Meaning you might want to use: enthaelt.inBeliebigerReihenfolge.genau(2).nullableWert('a') instead of: enthaelt.nullableWerte('a', 'a')

Exceptions

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

Return
This plant to support a fluent API.