interface DownCastFailureHandler<T : Any, TSub : T>
A handler which decides how the lambda -- which could have created subsequent assertions for the down-casted AssertionPlant.subject if the down-cast of the AssertionPlant.subject to type TSub did not fail -- should be used in reporting.
T
- The type of AssertionPlant.subject.
TSub
- The type to which AssertionPlant.subject should have been be down-casted, hence needs to be a
subtype of T.
abstract fun createAndAddAssertionToPlant(subType: KClass<TSub>, subjectPlant: BaseAssertionPlant<T?, *>, failingAssertion: Assertion, assertionCreator: AssertionPlant<TSub>.() -> Unit): Unit
Makes something with the given assertionCreator lambda; might add assertions to subjectPlant. |
class ExplanatoryDownCastFailureHandler<T : Any, TSub : T> : DownCastFailureHandler<T, TSub>
Represents an AnyNarrow.DownCastFailureHandler which wraps subsequent assertions into an ExplanatoryAssertionGroup. |