doc / ch.tutteli.atrium.logic.utils / ArgumentMapperBuilder

ArgumentMapperBuilder

class ArgumentMapperBuilder<out T> (source)

Builder to map variable length arguments formulated as (first: T, vararg others : T) to something else.

Properties

first

val first: T

others

val others: Array<out T>

Functions

to

fun <R> to(mapper: (T) -> R): Pair<R, Array<out R>>

Maps each argument to the given type R by using the given mapper

toExpect

fun <R> toExpect(assertionCreator: Expect<R>.(T) -> Unit): Pair<Expect<R>.() -> Unit, Array<Expect<R>.() -> Unit>>

Maps each argument to an Expect<R> lambda with receiver using the given assertionCreator (passing in the argument).

Extension Functions

toNullOr

fun <T : Any> ArgumentMapperBuilder<T?>.toNullOr(): ArgumentToNullOrMapperBuilder<T>

Maps each argument to null if it is already null and if not, then ...