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 IAssertionPlantNullable as well as the act function which is expected to throw a Throwable.

Constructors

<init>

ThrowableThrownBuilder(assertionVerb: ITranslatable, act: () -> Unit, reporter: IReporter)

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: ITranslatable

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

reporter

val reporter: IReporter

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: IAssertionPlant<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: IAssertionPlant<TExpected>.() -> Unit): Unit

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