doc / ch.tutteli.atrium.domain.builders.reporting / ExpectBuilder / OptionsStep

OptionsStep

interface OptionsStep<T> (source)

Step which allows to override previously defined properties -- such as use a different assertion verb -- but also allows to define options where usually a default value is used, such as use a customer Reporter.

Parameters

T - the type of the subject.

Properties

assertionVerb

abstract val assertionVerb: Translatable

The previously defined assertion verb.

maybeSubject

abstract val maybeSubject: Option<T>

The previously specified subject of the assertion.

Functions

withOptions

open fun withOptions(configuration: ExpectBuilder.OptionsChooser<T>.() -> Unit): ExpectBuilder.FinalStep<T>

Allows to define the ExpectOptions via an OptionsChooser-lambda which provides convenience functions.

abstract fun withOptions(expectOptions: ExpectOptions<T>): ExpectBuilder.FinalStep<T>

Uses the given expectOptions.

withoutOptions

abstract fun withoutOptions(): ExpectBuilder.FinalStep<T>

States explicitly that no optional ExpectOptions are defined, which means, build will create a new Expect based on the previously defined mandatory options but without any optional options or in other words, the default values are used for the optional options.

Companion Object Functions

create

fun <T> create(maybeSubject: Option<T>, assertionVerb: Translatable): ExpectBuilder.OptionsStep<T>