atrium-core-impl-robstoll-lib / ch.tutteli.atrium.reporting / TextFallbackAssertionFormatter

TextFallbackAssertionFormatter

class TextFallbackAssertionFormatter : AssertionFormatter

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<Class<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.expected) is formatted.

Functions

canFormat

fun canFormat(assertion: Assertion): Boolean

formatGroup

fun formatGroup(assertionGroup: AssertionGroup, methodObject: AssertionFormatterMethodObject, formatAssertions: (AssertionFormatterMethodObject, (Assertion) -> Unit) -> Unit): Unit

formatNonGroup

fun formatNonGroup(assertion: Assertion, methodObject: AssertionFormatterMethodObject): Unit