doc / ch.tutteli.atrium.api.infix.en_GB / entriesOf

entriesOf

fun <T> entriesOf(mapLike: T, reportOptionsInOrderOnly: InOrderOnlyReportingOptions.() -> Unit): WithInOrderOnlyReportingOptions<T> (source)

Helper function to create a WithInOrderOnlyReportingOptions wrapping an MapLike based on the given mapLike and the given reportOptionsInOrderOnly-configuration-lambda.

Parameters

mapLike - The MapLike whose elements this function is referring to.

reportOptionsInOrderOnly - The lambda configuring the InOrderOnlyReportingOptions.

Since
0.18.0

infix fun <K, V, T> MapLikeContains.EntryPointStep<K, V, T, InAnyOrderOnlySearchBehaviour>.entriesOf(expectedMapLike: MapLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (a MapLike) needs to contain only and all entries of the given expectedMapLike where it does not matter in which order they appear.

Delegates to keyValue which also means that it does not search for unique matches (see keyValue for more information).

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed. This function expects MapLike (which is a typealias for Any) to avoid cluttering the API.

Parameters

expectedMapLike - The MapLike whose elements are expected to be contained within this MapLike.

Exceptions

IllegalArgumentException - in case expectedMapLike is not a Map, Sequence or one of the Array types or the given expectedMapLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.15.0

infix fun <K, V, T> MapLikeContains.EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>.entriesOf(expectedMapLike: MapLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (a MapLike) needs to contain all entries of the given expectedMapLike where it does not matter in which order they appear.

Delegates to keyValue which also means that it does not search for unique matches (see keyValue for more information).

Notice that a runtime check applies which assures that only Iterable, Sequence or one of the Array types are passed. This function expects MapLike (which is a typealias for Any) to avoid cluttering the API.

Parameters

expectedMapLike - The MapLike whose elements are expected to be contained within this MapLike.

Exceptions

IllegalArgumentException - in case expectedMapLike is not a Map, Sequence or one of the Array types or the given expectedMapLike does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.15.0

infix fun <K, V, T> MapLikeContains.EntryPointStep<K, V, T, InOrderOnlySearchBehaviour>.entriesOf(expectedMapLike: MapLike): Expect<T> (source)

Finishes the specification of the sophisticated contains assertion where the subject (a MapLike) needs to contain only and all entries of the given expectedMapLike in the specified order.

Delegates to keyValue.

Notice that a runtime check applies which assures that only Map and IterableLike (i.e. Iterable, Sequence or one of the Array types) are passed (this can be changed via MapLikeToIterablePairTransformer and IterableLikeToIterableTransformer). This function expects MapLike (which is a typealias for Any) to avoid cluttering the API.

Exceptions

IllegalArgumentException - in case the given MapLike is an unsupported type, or in other words, if the transformation from the given MapLike to Iterable<Pair<K, V>> fails, or it does not have elements (is empty).

Return
an Expect for the subject of this expectation.

Since
0.15.0