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

TextFallbackAssertionFormatter

class TextFallbackAssertionFormatter : AssertionFormatter, TextAssertionFormatter (source)

Formats an Assertion for text output (e.g. to the console) by using the given assertionPairFormatter to format the group header for AssertionGroups and uses the bullet point defined for RootAssertionGroupType as prefix for the AssertionGroup.assertions.

The assertionPairFormatter is also used to format DescriptiveAssertions.

Currently the following Assertion types are supported:

In addition it defines a fallback for unknown AssertionGroupTypes as well as for unknown Assertion types.

Constructors

<init>

TextFallbackAssertionFormatter(bulletPoints: Map<KClass<out BulletPointIdentifier>, String>, assertionFormatterController: AssertionFormatterController, assertionPairFormatter: AssertionPairFormatter, objectFormatter: ObjectFormatter)

Formats an Assertion for text output (e.g. for the console) where it uses a given assertionPairFormatter which defines how an assertion pair (e.g. DescriptiveAssertion.description and DescriptiveAssertion.representation) is formatted.

Functions

canFormat

fun canFormat(assertion: Assertion): Boolean

Denotes whether this AssertionFormatter was created to format Assertions such as the given assertion or not.

formatGroup

fun formatGroup(assertionGroup: AssertionGroup, parameterObject: AssertionFormatterParameterObject, formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit): Unit

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

formatNonGroup

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

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

Inherited Functions

format

open fun format(assertion: Assertion, parameterObject: AssertionFormatterParameterObject): Unit

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