doc / ch.tutteli.atrium.assertions.builders / AssertionGroupDescriptionAndRepresentationOption

AssertionGroupDescriptionAndRepresentationOption

interface AssertionGroupDescriptionAndRepresentationOption<out T : AssertionGroupType, R>

Option step which allows to specify AssertionGroup.description and AssertionGroup.representation.

Properties

groupType

abstract val groupType: T

The previously defined AssertionGroup.type.

Functions

withDescriptionAndEmptyRepresentation

open fun withDescriptionAndEmptyRepresentation(description: String): R

Wraps the given description into an Untranslatable and uses it as AssertionGroup.description and uses RawString.EMPTY as AssertionGroup.representation.

open fun withDescriptionAndEmptyRepresentation(description: Translatable): R

Uses the given description as AssertionGroup.description and RawString.EMPTY as AssertionGroup.representation.

withDescriptionAndRepresentation

open fun withDescriptionAndRepresentation(description: String, representationProvider: () -> Any?): R

Turns the given description into an Untranslatable and the given representationProvider into a LazyRepresentation and uses them as AssertionGroup.description, AssertionGroup.representation respectively.

open fun withDescriptionAndRepresentation(description: Translatable, representationProvider: () -> Any?): R

Uses the given description as AssertionGroup.description and representationProvider to create a LazyRepresentation which is used as AssertionGroup.representation.

open fun withDescriptionAndRepresentation(description: String, representation: Any?): R

Wraps the given description into an Untranslatable and delegates to the overload which expects Translatable.

abstract fun withDescriptionAndRepresentation(description: Translatable, representation: Any?): R

Uses the given description as AssertionGroup.description and representation as AssertionGroup.representation unless representation is null in which case a representation for null is used (e.g. RawString.NULL).

Companion Object Functions

create

fun <T : AssertionGroupType, R> create(type: T, factory: (T, Translatable, Any) -> R): AssertionGroupDescriptionAndRepresentationOption<T, R>

Factory method to create an AssertionGroupDescriptionAndRepresentationOption with the given assertion group type and another factory method which creates the next step in the building process.