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

containsKey

fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T> (source)
Deprecated: Use toContainKey; will be removed with 1.0.0 at the latest

Expects that the subject of this expectation (a Map) contains the given key.

expect(mapOf(1 to "a")).containsKey(1)

fails {
    expect(mapOf(1 to "a")).containsKey(2) // fails because the map does not contain a key that equals 2
}

Return
an Expect for the subject of this expectation.