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

Package ch.tutteli.atrium.api.infix.en_GB.kotlin_1_3

Contains an API for types introduced with Kotlin 1.3

Functions

isFailure

fun <TExpected : Throwable> Expect<out Result<*>>.isFailure(): Expect<TExpected>

Expects that the subject of the assertion (a Result) is a Failure and that it encapsulates an exception of type TExpected.

infix fun <TExpected : Throwable> Expect<out Result<*>>.isFailure(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>

Expects that the subject of the assertion (a Result) is a Failure, it encapsulates an exception of type TExpected and that the exception holds all assertions the given assertionCreator creates.

toBe

infix fun <E, T : Result<E>> Expect<T>.toBe(success: success): Expect<E>

Expects that the subject of the assertion (a Result) is a Success and returns an Expect for the inner type E.

infix fun <E, T : Result<E>> Expect<T>.toBe(success: SuccessWithCreator<E>): Expect<T>

Expects that the subject of the assertion (a Result]) is a Success and that it holds all assertions the given SuccessWithCreator.assertionCreator creates.