FailureHandler

Represents a handler which is responsible to create the assertion resulting from a failed subject change.

A handler should augment the failing assertion with explanatory assertions in case the user supplied an assertionCreator lambda. Yet, a failure handler might also add additional information -- e.g. regarding the current subject.

Parameters

SubjectT

The type of the subject

SubjectAfterChangeT

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

Inheritors

Functions

Link copied to clipboard
abstract 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.