doc / ch.tutteli.atrium.reporting / IAssertionFormatter / canFormat

canFormat

abstract fun canFormat(assertion: IAssertion): Boolean

Denotes whether this IAssertionFormatter was created to format IAssertions such as the given assertion or not.

This function should be in sync with format and formatGroup. If assertion is an IAssertionGroup 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 IAssertionGroup is passed.

Parameters

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

Returns
true if this IAssertionFormatter can format the given assertion; false otherwise.