doc / ch.tutteli.atrium.reporting / AssertionFormatter

AssertionFormatter

interface AssertionFormatter (source)

Represents a formatter for Assertions and AssertionGroups.

Functions

canFormat

abstract fun canFormat(assertion: Assertion): Boolean

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

format

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

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

formatGroup

abstract 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

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

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

Companion Object Properties

CALL_FORMAT_GROUP

val CALL_FORMAT_GROUP: String

Companion Object Functions

throwNotIntendedForAssertionGroups

fun throwNotIntendedForAssertionGroups(): Unit

Inheritors

SingleAssertionGroupTypeFormatter

abstract class SingleAssertionGroupTypeFormatter<in T : AssertionGroupType> : AssertionFormatter

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

TextAssertionFormatter

interface TextAssertionFormatter : AssertionFormatter

Marker interface for AssertionFormatter which are intended for text output, e.g. for terminal output.

TextFallbackAssertionFormatter

class TextFallbackAssertionFormatter : AssertionFormatter, TextAssertionFormatter

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.