SubjectChanger

Defines the contract to change the subject of an assertion container (e.g. the subject of Expect) by creating a new Expect whereas the new Expect delegates assertion checking to a given original assertion container.

Inheritors

Types

Link copied to clipboard

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

Functions

Link copied to clipboard
abstract fun <SubjectT, SubjectAfterChangeT> reported(container: AssertionContainer<SubjectT>, description: Translatable, representation: Any, transformation: (SubjectT) -> Option<SubjectAfterChangeT>, failureHandler: SubjectChanger.FailureHandler<SubjectT, SubjectAfterChangeT>, maybeSubAssertions: Option<Expect<SubjectAfterChangeT>.() -> Unit>): Expect<SubjectAfterChangeT>

Changes to a new subject according to the given transformation -- the change as such is reflected in reporting by the given description and representation.

Link copied to clipboard

Changes to a new subject according to the given transformation without showing it in reporting and returns a new Expect for the new subject.