doc / ch.tutteli.atrium.logic.creating.impl / RootExpectOptionsChooserImpl

RootExpectOptionsChooserImpl

class RootExpectOptionsChooserImpl<T> : RootExpectBuilder.OptionsChooser<T> (source)

Constructors

<init>

RootExpectOptionsChooserImpl()

Functions

build

fun build(): RootExpectOptions<T>

prependChainedComponents

fun <I : Any> prependChainedComponents(kClass: KClass<I>, factories: Sequence<ComponentFactory>): Unit

withComponent

fun <I : Any> withComponent(kClass: KClass<I>, factory: (ComponentFactoryContainer) -> I): Unit

Expects a factory which creates the component of type I which is used instead of the currently specified factory.

withRepresentation

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).

withSingletonComponent

fun <I : Any> withSingletonComponent(kClass: KClass<I>, factory: (ComponentFactoryContainer) -> I): Unit

Expects a factory which creates the component of type I which is used instead of the currently specified factory.

withVerb

fun withVerb(verb: Translatable): Unit

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

Inherited Functions

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).

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 expectation verb instead of the previously defined verb.

Extension Functions

withComponent

fun <I : Any, T> RootExpectBuilder.OptionsChooser<T>.withComponent(factory: (ComponentFactoryContainer) -> I): Unit

Convenience function which infers the KClass usually required for RootExpectBuilder.OptionsChooser.withComponent.