FailureHandlerAdapter

Represents a SubjectChanger.FailureHandler which acts as an adapter for another failure handler by mapping first the given subject to another type SubjectIntermediateT which is understood as input of the other failure handler.

Effectively turning a FailureHandler<SubjectIntermediateT, SubjectAfterChangeT> into a FailureHandler<SubjectT, SubjectAfterChangeT> with the help of a mapping function (SubjectT) -> SubjectIntermediateT

Parameters

SubjectT

The type of the subject

SubjectIntermediateT

The type of the mapped subject

SubjectAfterChangeT

The type of the subject after the subject change (if it were possible).

Constructors

Properties

Functions

Link copied to clipboard
open override fun createAssertion(container: AssertionContainer<SubjectT>, descriptiveAssertion: Assertion, maybeAssertionCreator: Option<Expect<SubjectAfterChangeT>.() -> Unit>): Assertion

Creates the failing assertion most likely based on the given descriptiveAssertion -- which in turn is based on the previously specified description, representation etc. -- and should incorporate the assertions maybeAssertionCreator would have created for the new subject as explanatory assertions.