doc / ch.tutteli.atrium.domain.creating.throwable.thrown / ThrowableThrown / Creator / executeActAndCreateAssertion

executeActAndCreateAssertion

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

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 ThrowableThrown.Builder 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.