doc / ch.tutteli.atrium.assertions.throwable.thrown / IThrowableThrown / ICreator / executeActAndCreateAssertion

executeActAndCreateAssertion

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

Executes the act lambda of the given throwableThrownBuilder, catches any thrown Throwable, creates based on it a corresponding IAssertion 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 IBasicAssertion. 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.