doc / ch.tutteli.atrium.assertions.throwable.thrown.builders / ThrowableThrownBuilder

ThrowableThrownBuilder

class ThrowableThrownBuilder

Represents the entry point of the fluent API of sophisticated a Throwable was thrown assertions.

It contains the assertionVerb and reporter which will be used to create an AssertionPlantNullable as well as the act function which is expected to throw a Throwable.

Constructors

<init>

ThrowableThrownBuilder(assertionVerb: Translatable, act: () -> Unit, reporter: Reporter)

Represents the entry point of the fluent API of sophisticated a Throwable was thrown assertions.

Properties

act

val act: () -> Unit

The function which is expected to throw a Throwable.

assertionVerb

val assertionVerb: Translatable

The assertion verb which will be used inter alia in error reporting.

reporter

val reporter: Reporter

The reporter which will be use for a IAtriumFactory.newThrowingAssertionChecker.

Extension Functions

toThrow

fun <TExpected : Throwable> ThrowableThrownBuilder.toThrow(): Unit

Makes the assertion that the thrown Throwable is of type TExpected.

fun <TExpected : Throwable> ThrowableThrownBuilder.toThrow(assertionCreator: AssertionPlant<TExpected>.() -> Unit): Unit

Makes the assertion that the thrown Throwable is of type TExpected and it assertionCreator which are checked additionally as well.

toThrow

fun <TExpected : Throwable> ThrowableThrownBuilder.toThrow(): Unit

Makes the assertion that the thrown Throwable is of type TExpected.

infix fun <TExpected : Throwable> ThrowableThrownBuilder.toThrow(assertionCreator: AssertionPlant<TExpected>.() -> Unit): Unit

Makes the assertion that the thrown Throwable is of type TExpected and it assertionCreator which are checked additionally as well.

wirft

fun <TExpected : Throwable> ThrowableThrownBuilder.wirft(): Unit

Makes the assertion that the thrown Throwable is of type TExpected.

fun <TExpected : Throwable> ThrowableThrownBuilder.wirft(assertionCreator: AssertionPlant<TExpected>.() -> Unit): Unit

Makes the assertion that the thrown Throwable is of type TExpected and it assertionCreator which are checked additionally as well.