doc / ch.tutteli.atrium.api.cc.de_CH / wirft

wirft

inline fun <reified TExpected : Throwable> ThrowableThrown.Builder.wirft(noinline assertionCreator: Assert<TExpected>.() -> Unit): Unit (source)
Deprecated: api-cc-de_CH is discontinued, switch to api-fluent-en_GB; will be removed with 1.0.0

Makes the assertion that the thrown Throwable is of type TExpected and holds all assertions the assertionCreator might create in addition.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
Notice, that this assertion function cannot provide a fluent API because it depends on whether the first assertion (a Throwable was thrown) holds or not. Define subsequent assertions via the assertionCreator lambda.

inline fun <reified TExpected : Throwable> ThrowableThrown.Builder.wirft(): Unit (source)
Deprecated: Does not add enough to be a valid alternative to the overload with assertionCreator; will be removed with 1.0.0

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

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
Notice, that this assertion function cannot provide a fluent API because it depends on whether the assertion (a Throwable was thrown and is of type TExpected) holds or not. If you want to define subsequent assertions on the down-casted Throwable, then use the overload which expects a lambda (where you can define subsequent assertions).