doc / ch.tutteli.atrium.assertions.builders / Explanatory / ExplanationOption / withExplanation

withExplanation

open fun withExplanation(translatable: Translatable, arg: Any, vararg otherArgs: Any): Explanatory.FinalStep

Uses the given translatable together with the arg and optionally otherArgs to create an TranslatableWithArgs which is then used as ExplanatoryAssertion.explanation.

It delegates to the overload which expects a single Translatable; see there for more details about how the Translatable is used as ExplanatoryAssertion.explanation.

open fun withExplanation(description: String): Explanatory.FinalStep

Uses the given description as explanation.

open fun withExplanation(translatable: Translatable): Explanatory.FinalStep

Uses the given translatable as explanation.

In detail, the given translatable is turned into a RawString so that an ObjectFormatter translates the given translatable and treats the result as raw string.

abstract fun withExplanation(explanation: Any?): Explanatory.FinalStep

Uses the given explanation as ExplanatoryAssertion.explanation.

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