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

NoSpecialChildFormattingSingleAssertionGroupTypeFormatter

abstract class NoSpecialChildFormattingSingleAssertionGroupTypeFormatter<in T : AssertionGroupType> : SingleAssertionGroupTypeFormatter<T> (source)

A base type for AssertionFormatter which canFormat only AssertionGroups of one specific AssertionGroupType and does nothing special when it comes to formatting AssertionGroup.assertions (merely delegates to assertionFormatterController).

Parameters

T - The AssertionGroupType which the concrete sub class canFormat.

Constructors

<init>

NoSpecialChildFormattingSingleAssertionGroupTypeFormatter(clazz: KClass<T>, assertionFormatterController: AssertionFormatterController)

A base type for AssertionFormatter which canFormat only AssertionGroups of one specific AssertionGroupType.

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.

Inherited Functions

canFormat

fun canFormat(assertion: Assertion): Boolean

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

formatGroup

fun formatGroup(assertionGroup: AssertionGroup, parameterObject: AssertionFormatterParameterObject, formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> 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.

formatGroupHeaderAndGetChildParameterObject

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

formatNonGroup

fun formatNonGroup(assertion: Assertion, parameterObject: AssertionFormatterParameterObject): Nothing

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

Inheritors

TextExplanatoryAssertionGroupFormatter

class TextExplanatoryAssertionGroupFormatter : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter<ExplanatoryAssertionGroupType>, TextAssertionFormatter

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.

TextFeatureAssertionGroupFormatter

class TextFeatureAssertionGroupFormatter : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter<FeatureAssertionGroupType>, TextAssertionFormatter

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.

TextListBasedAssertionGroupFormatter

abstract class TextListBasedAssertionGroupFormatter<in T : AssertionGroupType> : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter<T>, TextAssertionFormatter

Represents an AssertionFormatter which formats AssertionGroups with type T by using the given assertionPairFormatter to format the group header and using the given bulletPoint (see constructor) to prefix the AssertionGroup.assertions.