main.kotlin.ch.tutteli.atrium.logic.creating.impl.FeatureExpectOptionsChooserImpl.kt Maven / Gradle / Ivy
package ch.tutteli.atrium.logic.creating.impl
import ch.tutteli.atrium.core.ExperimentalNewExpectTypes
import ch.tutteli.atrium.creating.FeatureExpectOptions
import ch.tutteli.atrium.logic.creating.FeatureExpectOptionsChooser
import ch.tutteli.atrium.reporting.translating.Translatable
@ExperimentalNewExpectTypes
class FeatureExpectOptionsChooserImpl : FeatureExpectOptionsChooser {
private var description: Translatable? = null
private var representationInsteadOfFeature: ((R) -> Any)? = null
override fun withDescription(description: Translatable) {
this.description = description
}
override fun withRepresentation(representationProvider: (R) -> Any) {
this.representationInsteadOfFeature = representationProvider
}
fun build(): FeatureExpectOptions = FeatureExpectOptions(description, representationInsteadOfFeature)
}