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

containsNotKey

fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T> (source)

Expects that the subject of this expectation (a Map) does not contain the given key.

expect(mapOf(1 to "a")).containsNotKey(2)

fails {
    expect(mapOf(1 to "a")).containsNotKey(1)   // fails because the map contains key that equals 1
}

Return
an Expect for the subject of this expectation.