doc / ch.tutteli.atrium.reporting / AssertionFormatterMethodObject

AssertionFormatterMethodObject

class AssertionFormatterMethodObject

A method object used for interactions between IAssertionFormatterController and IAssertionFormatter.

Properties

assertionFilter

val assertionFilter: (IAssertion) -> Boolean

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

prefix

val prefix: String

The current prefix per assertion.

sb

val sb: StringBuilder

The StringBuilder to which the formatted IAssertion will be appended.

Functions

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): AssertionFormatterMethodObject

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

createChildWithNewPrefixAndAdditionalIndent

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

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

createForDoNotFilterAssertionGroup

fun createForDoNotFilterAssertionGroup(): AssertionFormatterMethodObject

Clones the current AssertionFormatterMethodObject and increases numberOfDoNotFilterGroups by one because it is assumed that the resulting methodObject is used to format an IAssertionGroup of type IDoNotFilterAssertionGroupType.

isNotInDoNotFilterGroup

fun isNotInDoNotFilterGroup(): Boolean

Indicates that the formatting process is currently not formatting the IAssertions (or any nested assertion) of an IAssertionGroup of type IDoNotFilterAssertionGroupType.

Companion Object Functions

new

fun new(sb: StringBuilder, assertionFilter: (IAssertion) -> Boolean): AssertionFormatterMethodObject

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