inline fun <reified TExpected : Throwable> ThrowableThrown.Builder.wirft(noinline assertionCreator: Assert<TExpected>.() -> Unit): Unit
(source)Makes the assertion that the thrown Throwable is of type TExpected and holds all assertions the assertionCreator might create in addition.
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)Makes the assertion that the thrown Throwable is of type TExpected.
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).