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

withDescriptionAndRepresentation

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

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 (source)

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 (source)

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

See the corresponding overload for more information.

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

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

Use the overload which expects a representation provider in case the computation is expensive.

Notice, if you want to use text (e.g. a String) as representation, then wrap it into a RawString via RawString.create and pass the RawString instead.