toContainEntriesOf

fun <K, V : Any, T : Map<out K, V?>> Expect<T>.toContainEntriesOf(mapLike: MapLike): Expect<T>(source)

Expects that the subject of this expectation (a Map) contains the key-value pairs of the given mapLike.

Delegates to toContain.inAnyOrder.entriesOf

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

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

fails { // because the map does not contain entry with key 1 and value "b"
    expect(mapOf(1 to "a")).toContainEntriesOf(mapOf(1 to "b"))
}