doc / ch.tutteli.atrium.assertions.throwable.thrown / ThrowableThrown / Creator / executeActAndCreateAssertion

executeActAndCreateAssertion

abstract fun executeActAndCreateAssertion(throwableThrownBuilder: ThrowableThrownBuilder, description: Translatable, expectedType: KClass<TExpected>, assertionCreator: AssertionPlant<TExpected>.() -> Unit): Unit

Executes the act lambda of the given throwableThrownBuilder, catches any thrown Throwable, creates based on it a corresponding Assertion representing the sophisticated assertion and also checks whether it holds or not.

Parameters

throwableThrownBuilder - The ThrowableThrownBuilder containing inter alia the act lambda. description - The description of the resulting DescriptiveAssertion. expectedType - The expected type of the Throwable used for casting and probably in reporting. assertionCreator - The assertion creator which defines subsequent assertions for the Throwable in case it was thrown as expected and is of the expected type TExpected.