doc / ch.tutteli.atrium.logic.creating.transformers / SubjectChangerBuilder / DescriptionRepresentationStep

DescriptionRepresentationStep

interface DescriptionRepresentationStep<T> (source)

Step which allows to specify the description and representation of the change.

Parameters

T - the type of the current subject.

Properties

container

abstract val container: AssertionContainer<T>

The previously specified assertion container to which the new Expect will delegate assertion checking.

Functions

downCastTo

open fun <TSub : Any> downCastTo(subType: KClass<TSub>): SubjectChangerBuilder.FailureHandlerStep<T, TSub>

Uses DescriptionAnyAssertion.IS_A as description of the change, the given subType as representation and tries to perform a down-cast of container's AssertionContainer.maybeSubject to the given type TSub

withDescriptionAndRepresentation

open fun withDescriptionAndRepresentation(description: String, representation: Any?): SubjectChangerBuilder.TransformationStep<T>

Uses the given description and representation to represent the change by delegating to the other overload which expects a Translatable instead of a String.

abstract fun withDescriptionAndRepresentation(description: Translatable, representation: Any?): SubjectChangerBuilder.TransformationStep<T>

Uses the given description and representation to represent the change. Moreover, subsequent options in the building step allow to define rules when the change cannot be applied, in such a case an alternative description and representation might be used (depending on the implementation and chosen options).

Companion Object Functions

invoke

operator fun <T> invoke(container: AssertionContainer<T>): SubjectChangerBuilder.DescriptionRepresentationStep<T>

Creates a DescriptionRepresentationStep in the context of the SubjectChangerBuilder.

Inheritors

DescriptionRepresentationStepImpl

class DescriptionRepresentationStepImpl<T> : SubjectChangerBuilder.DescriptionRepresentationStep<T>