doc / ch.tutteli.atrium.reporting / AssertionFormatterParameterObject

AssertionFormatterParameterObject

class AssertionFormatterParameterObject (source)

A parameter object used for interactions between AssertionFormatterController and AssertionFormatter.

Properties

assertionFilter

val assertionFilter: (Assertion) -> Boolean

Can be used used to filter out Assertions which should not be formatted.

prefix

val prefix: String

The current prefix per assertion.

sb

val sb: StringBuilder

The StringBuilder to which the formatted Assertion will be appended.

Functions

appendLnAndIndent

fun appendLnAndIndent(): Unit

Appends a new line (system separator), spaces equal to the number of indentLevel and the prefix to sb.

appendLnIndentAndPrefix

fun appendLnIndentAndPrefix(): Unit

Appends a new line (system separator), spaces equal to the number of indentLevel and the prefix to sb.

createChildWithNewPrefix

fun createChildWithNewPrefix(newPrefix: String): AssertionFormatterParameterObject

Creates an AssertionFormatterParameterObject for kind of a child of the current parameter object using the given newPrefix (the child will typically be used to indent Assertions one level more).

createChildWithNewPrefixAndAdditionalIndent

fun createChildWithNewPrefixAndAdditionalIndent(newPrefix: String, additionalIndent: Int): AssertionFormatterParameterObject

Creates an AssertionFormatterParameterObject for kind of a child of the current parameter object using the given newPrefix and an additionalIndent (the child will typically be used to indent Assertions one level more).

createForDoNotFilterAssertionGroup

fun createForDoNotFilterAssertionGroup(): AssertionFormatterParameterObject

Clones the current AssertionFormatterParameterObject and increases numberOfDoNotFilterGroups by one because it is assumed that the resulting parameter object is used to format an AssertionGroup of type DoNotFilterAssertionGroupType.

createForExplanatoryFilterAssertionGroup

fun createForExplanatoryFilterAssertionGroup(newPrefix: String = prefix): AssertionFormatterParameterObject

Clones the current AssertionFormatterParameterObject and increases numberOfDoNotFilterGroups by one because it is assumed that the resulting parameter object is used to format an AssertionGroup of type DoNotFilterAssertionGroupType.

indent

fun indent(numberOfSpaces: Int): Unit

Appends spaces equal to numberOfSpaces to sb.

isNotInDoNotFilterGroup

fun isNotInDoNotFilterGroup(): Boolean

Indicates that the formatting process is currently not formatting the Assertions (or any nested assertion) of an AssertionGroup of type DoNotFilterAssertionGroupType.

isNotInExplanatoryFilterGroup

fun isNotInExplanatoryFilterGroup(): Boolean

Indicates that the formatting process is currently not formatting the Assertions (or any nested assertion) of an AssertionGroup of type ExplanatoryAssertionGroupType.

Companion Object Functions

new

fun new(sb: StringBuilder, assertionFilter: (Assertion) -> Boolean): AssertionFormatterParameterObject

Creates a new AssertionFormatterParameterObject, one without a prefix and with indentLevel = 0.