notToContainKey

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

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

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

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

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