keyValues

fun <K, V : Any> keyValues(keyValue: KeyWithValueCreator<K, V>, vararg otherKeyValues: KeyWithValueCreator<K, V>): KeyValues<K, V>(source)

Deprecated

Use entries instead, will be removed with 2.0.0 at the latest

Replace with

import ch.tutteli.atrium.api.infix.en_GB.entries
entries(keyValue, *otherKeyValues)

Helper function to create a KeyValues based on the given keyValue and otherKeyValues -- allows expressing Pair<K, (Expect<V>.() -> Unit)?>, vararg Pair<K, (Expect<V>.() -> Unit)?>.

Samples

expect(mapOf(1 to "a")) toContain entries(
    keyValue(1) { // subject inside this expectation-group is of type String (actually "a")
        this toEqual "a"
    }
)

fails {
    expect(mapOf(1 to "a")) toContain entries(
        keyValue(1) { // subject inside this expectation-group is of type String (actually "a")
            this toEqual "b"
        }
    )
}

fun <K, V : Any> keyValues(keyValue: KeyWithValueCreator<K, V>, vararg otherKeyValues: KeyWithValueCreator<K, V>, reportOptionsInOrderOnly: InOrderOnlyReportingOptions.() -> Unit): WithInOrderOnlyReportingOptions<KeyValues<K, V>>(source)

Deprecated

Use entries instead, will be removed with 2.0.0 at the latest

Replace with

import ch.tutteli.atrium.api.infix.en_GB.entries
entries(keyValue, *otherKeyValues, reportOptionsInOrderOnly)

Helper function to create a KeyValues based on the given keyValue and otherKeyValues -- allows expressing Pair<K, (Expect<V>.() -> Unit)?>, vararg Pair<K, (Expect<V>.() -> Unit)?>.

Since

0.18.0

Parameters

reportOptionsInOrderOnly

The lambda configuring the InOrderOnlyReportingOptions -- it is optional where the default InOrderOnlyReportingOptions apply if not specified.