doc / ch.tutteli.atrium.api.fluent.en_GB / containsOnly

containsOnly

fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(keyValuePair: Pair<K, V>, vararg otherPairs: Pair<K, V>): Expect<T>

Expects that the subject of the assertion (a Map) contains only (in any order) a key as defined by keyValuePair's Pair.first with a corresponding value as defined by keyValuePair's Pair.second -- optionally the same assertions are created for the otherPairs.

Delegates to contains.inAnyOrder.only.entries(keyValuePair, *otherPairs)

Exceptions

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

Return
An Expect for the current subject of the assertion.

inline fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly(keyValue: KeyValue<K, V>, vararg otherKeyValues: KeyValue<K, V>): Expect<T>

Expects that the subject of the assertion (a Map) contains only (in any order) a key as defined by keyValue's KeyValue.key with a corresponding value which either holds all assertions keyValue's KeyValue.valueAssertionCreatorOrNull creates or needs to be null in case KeyValue.valueAssertionCreatorOrNull is defined as null -- optionally the same assertions are created for the otherKeyValues.

Delegates to contains.inAnyOrder.only.entries(keyValue, *otherKeyValues)

Exceptions

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

Return
An Expect for the current subject of the assertion.