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

isKeyValue

fun <K, V, T : Entry<K, V>> Expect<T>.isKeyValue(key: K, value: V): Expect<T> (source)
Deprecated: Use toEqualKeyValue; will be removed with 1.0.0 at the latest

Expects that the property Map.Entry.key of the subject of this expectation is equal to the given key and the property Map.Entry.value is equal to the given value.

Kind of a shortcut for and { key { toEqual(key) }; value { toEqual(value) } } where and denotes an expectation group block. Yet, the actual behaviour depends on implementation - could also be fail fast for instance or augment reporting etc.

expect(mapOf(1 to "a").entries.first()).toEqualKeyValue(1, "a")

fails {
    expect(mapOf(1 to "a").entries.first()).toEqualKeyValue(1, "b")
}

Return
an Expect for the subject of this expectation.