doc / ch.tutteli.atrium.domain.creating.changers / SubjectChanger

SubjectChanger

interface SubjectChanger
Deprecated: Use SubjectChanger from atrium-logic; will be removed with 1.0.0

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.

Types

FailureHandler

interface FailureHandler<T, R>

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

Functions

reported

abstract fun <T, R> reported(originalAssertionContainer: Expect<T>, description: Translatable, representation: Any, transformation: (T) -> Option<R>, failureHandler: SubjectChanger.FailureHandler<T, R>, maybeSubAssertions: Option<Expect<R>.() -> Unit>): Expect<R>

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

unreported

abstract fun <T, R> unreported(originalAssertionContainer: Expect<T>, transformation: (T) -> R): Expect<R>

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

unreportedNullableToAssert

abstract fun <T, R> unreportedNullableToAssert(originalPlant: SubjectProvider<T>, transformation: (T) -> R): AssertionPlantNullable<R>

unreportedToAssert

abstract fun <T, R : Any> unreportedToAssert(originalPlant: SubjectProvider<T>, transformation: (T) -> R): Assert<R>