toEqualKeyValue

infix fun <K, V, T : Map.Entry<K, V>> Expect<T>.toEqualKeyValue(keyValuePair: Pair<K, V>): Expect<T>(source)

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.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

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

fails { // because (1 to "a") is not equal to (1 to "b")
    expect(mapOf(1 to "a").entries.first()) toEqualKeyValue (1 to "b")
}