doc / ch.tutteli.atrium.api.infix.en_GB.creating.feature / FeatureWithCreator

FeatureWithCreator

data class FeatureWithCreator<T, R> (source)

Parameter object which contains a description of a feature along with an extractor which actually extracts the feature out of a subject of an assertion + an assertionCreator which defines assertions for the feature.

Use of(K..., ...) { ... } to create this representation where the first argument is the extractor in form of a KProperty1 or a KFunctionX, the last an assertionCreator-lambda and the remaining arguments in-between the required arguments in case of a KFunctionX where X > 1.

Properties

assertionCreator

val assertionCreator: Expect<R>.() -> Unit

The assertionCreator-lambda which defines assertions for the feature.

descriptionProvider

val descriptionProvider: (ComponentFactoryContainer) -> String

Provides the description of the feature.

extractor

val extractor: (T) -> R

The extractor which extracts the feature out of the subject of the expectation.