toBeAFailure

inline fun <TExpected : Throwable> Expect<out Result<*>>.toBeAFailure(): Expect<TExpected>(source)

Expects that the subject of this expectation (a Result) is a failure (Result.isFailure) and that it encapsulates an exception of type TExpected.

Return

An Expect with the new type TExpected

Since

0.17.0

Samples

ch.tutteli.atrium.api.fluent.en_GB.kotlin_1_3.samples.ResultExpectationSamples.toBeAFailureFeature
inline fun <TExpected : Throwable> Expect<out Result<*>>.toBeAFailure(noinline assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>(source)

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

Return

An Expect with the new type TExpected

Since

0.17.0

Samples

ch.tutteli.atrium.api.fluent.en_GB.kotlin_1_3.samples.ResultExpectationSamples.toBeAFailure