doc / ch.tutteli.atrium.assertions.any.narrow.failurehandler / ExplanatoryDownCastFailureHandler

ExplanatoryDownCastFailureHandler

class ExplanatoryDownCastFailureHandler<T : Any, TSub : T> : IDownCastFailureHandler<T, TSub>

Represents an IAnyNarrow.IDownCastFailureHandler which wraps subsequent assertions into an ExplanatoryAssertionGroup.

Parameters

T - The type of the IAssertionPlant.subject. T - The type to which the IAssertionPlant.subject should have been down-casted.

Constructors

<init>

ExplanatoryDownCastFailureHandler()

Represents an IAnyNarrow.IDownCastFailureHandler which wraps subsequent assertions into an ExplanatoryAssertionGroup.

Functions

createAndAddAssertionToPlant

fun createAndAddAssertionToPlant(subType: KClass<TSub>, subjectPlant: IBaseAssertionPlant<T?, *>, failingAssertion: IAssertion, assertionCreator: IAssertionPlant<TSub>.() -> Unit): Unit

Wraps the assertions which might be created by assertionCreator into an ExplanatoryAssertionGroup and adds it to the given subjectPlant.