doc / ch.tutteli.atrium.reporting.text.impl / TextFallbackAssertionFormatter / canFormat

canFormat

fun canFormat(assertion: Assertion): Boolean (source)

Overrides AssertionFormatter.canFormat

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

This function should be in sync with format and formatGroup. If assertion is an AssertionGroup and this method returns true then formatGroup should be able to format the given assertion. On the other hand, if it returns false then formatGroup should throw an UnsupportedOperationException. The same applies for format where format should additionally throw an UnsupportedOperationException if an AssertionGroup is passed.

Parameters

assertion - The Assertion which builds the basis to answer the question whether this AssertionFormatter can format such kinds or not.

Return
true if this AssertionFormatter ca format the given assertion; false otherwise.