inline fun <S : Any, T : Any> newExplanatoryWithHint(noinline showHint: () -> Boolean, noinline failureHintFactory: () -> Assertion): AnyTypeTransformation.FailureHandler<S, T>
(source)
Overrides FailureHandlerFactory.newExplanatoryWithHint
Creates a AnyTypeTransformation.FailureHandler which wraps subsequent assertions into an
AssertionGroup with an ExplanatoryAssertionGroupType so that the user of Atrium can see in reporting
what one wanted to assert additionally -- moreover it includes a hint about the subject which shall only be shown
if showHint evaluates to true
in which case the given failureHintFactory should be used to create the hint.
As an example, Atrium uses this failure handler internally to show the message of a thrown Throwable in case it is of a different type than the expected one.
showHint
- Indicates whether the failure hint shall be included or not