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

OptionsChooser

interface OptionsChooser<T> (source)
Deprecated: Use RootExpectBuilder.OptionsChooser from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)

Helper lambda to specify ExpectOptions via convenience methods.

Calling multiple times the same method overrides the previously defined value.

Functions

withReporter

abstract fun withReporter(reporter: Reporter): Unit

Uses the given reporter instead of the default reporter.

withRepresentation

open fun withRepresentation(textRepresentation: String): Unit

Wraps the given textRepresentation into a Text and uses it as representation of the subject instead of the representation that has been defined so far (which defaults to the subject itself).

abstract fun withRepresentation(representationProvider: (T) -> Any): Unit

Uses the given representationProvider to retrieve a representation which can be based on the current subject where it is used as new representation of the subject instead of the representation that has been defined so far (which defaults to the subject itself).

withVerb

open fun withVerb(verb: String): Unit

Wraps the given verb into an Untranslatable and passes it to the overload which expects a Translatable -- this is then used as custom assertion verb instead of the previously defined verb.

abstract fun withVerb(verb: Translatable): Unit

Uses the given verb as assertion verb instead of the previously defined verb.

Companion Object Functions

createAndBuild

fun <T> createAndBuild(configuration: ExpectBuilder.OptionsChooser<T>.() -> Unit): ExpectOptions<T>