doc / ch.tutteli.atrium.assertions.builders / Descriptive / DescriptionOption

DescriptionOption

interface DescriptionOption<R> (source)

Option step which allows to specify the description of a descriptive like assertion (such as DescriptiveAssertion).

Properties

test

abstract val test: () -> Boolean

The previously defined test which is used to determine Assertion.holds.

Functions

withDescriptionAndRepresentation

abstract fun withDescriptionAndRepresentation(description: Translatable, representation: Any?): R

Uses the given description as DescriptiveAssertion.description and representation as DescriptiveAssertion.representation unless representation is null in which case a representation for null is used (e.g. RawString.NULL).

Companion Object Functions

create

fun <R> create(test: () -> Boolean, factory: (() -> Boolean, Translatable, Any) -> R): DescriptionOption<R>

Factory method to create the DescriptionOption step based on the given test and another factory method which creates the next step in the building process of a descriptive assertion.

Extension Functions

withFailureHint

fun DescriptionOption<FinalStep>.withFailureHint(failureHintFactory: () -> Assertion): ShowOption

Option to create a DescriptiveAssertion like assertion with an additional hint which might be shown if the Descriptive.DescriptionOption.test fails.