doc / ch.tutteli.atrium.reporting.text.impl / TextExplanatoryAssertionGroupFormatter

TextExplanatoryAssertionGroupFormatter

class TextExplanatoryAssertionGroupFormatter : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter<ExplanatoryAssertionGroupType>, TextAssertionFormatter (source)

Represents an AssertionFormatter which formats AssertionGroups with an ExplanatoryAssertionGroupType by neglecting the group header and defining an child-AssertionFormatterParameterObject which indicates that we are in an explanatory assertion.

Furthermore it uses the bullet point defined for WarningAssertionGroupType in bulletPoints (see constructor) ("❗❗ " if absent) as prefix for the child-AssertionFormatterParameterObject if the AssertionGroup.type is a WarningAssertionGroupType. Otherwise it is using the bullet point defined for ExplanatoryAssertionGroupType ("» " if absent).

Its usage is intended for text output (e.g. to the console).

Constructors

<init>

TextExplanatoryAssertionGroupFormatter(bulletPoints: Map<KClass<out BulletPointIdentifier>, String>, assertionFormatterController: AssertionFormatterController)

Represents an AssertionFormatter which formats AssertionGroups with an ExplanatoryAssertionGroupType by defining only an AssertionFormatterParameterObject -- which indicates that we are in an explanatory assertion group and uses the bulletPoints (passed as argument) as prefix -- and completely ignoring AssertionGroup.description and AssertionGroup.representation.

Functions

formatGroupHeaderAndGetChildParameterObject

fun formatGroupHeaderAndGetChildParameterObject(assertionGroup: AssertionGroup, parameterObject: AssertionFormatterParameterObject): AssertionFormatterParameterObject

Formats the group header of the given assertionGroup (with type T) -- appends the result to the sb of the given parameterObject -- and returns the AssertionFormatterParameterObject which shall be used for the AssertionGroup.assertions.

Inherited Functions

formatGroupAssertions

open fun formatGroupAssertions(formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit, childParameterObject: AssertionFormatterParameterObject): Unit

Formats the AssertionGroup.assertions -- has to call the given formatAssertions function in order that the AssertionFormatterController can steer the process.