format

open override fun format(assertion: Assertion, parameterObject: AssertionFormatterParameterObject)(source)

Finds a suitable AssertionFormatter -- which was previously registered -- for the given assertion and formats it.

The parameterObject allows to define an assertionFilter to filter out Assertions (for instance, filter out messages which hold. Moreover the controller should take into account whether the control flow AssertionFormatterParameterObject.isNotInDoNotFilterGroup or is in such a group, in which case the filtering should not apply.

Last but not least, an AssertionFormatterController has to take care of AssertionGroup with an InvisibleAssertionGroupType as its AssertionGroup.type. Such groups should not be format as group but instead each AssertionGroup.assertions should be formatted. This also means, that if there are nested expectation-groups with an InvisibleAssertionGroupType, that their AssertionGroup.assertions should be formatted as if they were all added directly in the surrounding expectation-group.

Parameters

assertion

The assertion which shall be formatted.

parameterObject

Used to share data between this AssertionFormatterController and the registered AssertionFormatters.

See also

Throws