inline fun <reified TExpected : Throwable> ThrowableThrown.Builder.toThrow(noinline assertionCreator: Assert<TExpected>.() -> Unit): Unit
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.