doc / ch.tutteli.atrium.assertions.any.narrow / IAnyNarrow / IDownCastFailureHandler

IDownCastFailureHandler

interface IDownCastFailureHandler<T : Any, TSub : T>

A handler which decides how the lambda -- which could have created subsequent assertions for the down-casted IAssertionPlant.subject, in case the down-cast of the IAssertionPlant.subject to type TSub did not have fail -- should be used in reporting.

Parameters

T - The type of IAssertionPlant.subject. TSub - The type to which IAssertionPlant.subject should have been be down-casted, hence needs to be a subtype of T.

Functions

createAndAddAssertionToPlant

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

Makes something with the given assertionCreator lambda; might add assertions to subjectPlant.

Inheritors

ExplanatoryDownCastFailureHandler

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

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