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

getExisting

infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V> (source)

Expects that the subject of this expectation (a Map) contains the given key, creates an Expect for the corresponding value and returns the newly created assertion container, so that further fluent calls are assertions about it.

Return
The newly created Expect for the extracted feature.

infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: KeyWithCreator<K, V>): Expect<T> (source)

Expects that the subject of this expectation (a Map) contains the given key and that the corresponding value holds all assertions the given KeyWithCreator.assertionCreator creates for it.

Parameters

key - Use the function key(...) { ... } to create a KeyWithCreator where the first parameter corresponds to the key and the second is the assertionCreator-lambda

Return
an Expect for the subject of this expectation.