TextFeatureAssertionGroupFormatter

Represents an AssertionFormatter which formats AssertionGroups with a FeatureAssertionGroupType by using the given assertionPairFormatter to format the group header, additionally prefixing it with the "bullet point" (typically an arrow) defined for PrefixFeatureAssertionGroupHeader and uses the bullet point defined for FeatureAssertionGroupType as prefix for the AssertionGroup.assertions.

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

Parameters

bulletPoints

The formatter uses the bullet point defined for PrefixFeatureAssertionGroupHeader ("▶ " if absent) as prefix of the group header and FeatureAssertionGroupType ("◾ " if absent) as prefix of the child-AssertionFormatterParameterObject.

assertionFormatterController

The controller to which this formatter gives back the control when it comes to format children of an AssertionGroup.

assertionPairFormatter

The formatter which is used to format assertion pairs.

Constructors

Link copied to clipboard
constructor(bulletPoints: Map<KClass<out BulletPointIdentifier>, String>, assertionFormatterController: AssertionFormatterController, assertionPairFormatter: AssertionPairFormatter)

Represents an AssertionFormatter which formats AssertionGroups with an FeatureAssertionGroupType by using the given assertionPairFormatter to format the group header, additionally prefixing it with the "bullet point" (typically an arrow) defined for PrefixFeatureAssertionGroupHeader and uses the bullet point defined for FeatureAssertionGroupType as prefix for the AssertionGroup.assertions.

Functions

Link copied to clipboard
override fun canFormat(assertion: Assertion): Boolean

Returns true if the given assertion is an AssertionGroup and its type is T or a sub type.

Link copied to clipboard
open fun format(assertion: Assertion, parameterObject: AssertionFormatterParameterObject)

Formats the given assertion and appends the result to the sb of the given parameterObject.

Link copied to clipboard
override fun formatGroup(assertionGroup: AssertionGroup, parameterObject: AssertionFormatterParameterObject, formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit)

Checks whether assertionGroup is T or a sub type and if so, calls formatGroupHeaderAndGetChildParameterObject and uses the resulting child-AssertionFormatterParameterObject to format AssertionGroup.assertions.

Link copied to clipboard
override fun formatNonGroup(assertion: Assertion, parameterObject: AssertionFormatterParameterObject): Nothing

Always throws an UnsupportedOperationException, because this AssertionFormatter can only format AssertionGroups.