doc / ch.tutteli.atrium.assertions.builders / DescriptiveAssertionWithFailureHint / ShowOption

ShowOption

interface ShowOption (source)

Option which allows specifying in which situations the failure hint should be shown.

Properties

showForAnyFailure

abstract val showForAnyFailure: Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep>

Defines that the failure hint shall be shown in any case.

Functions

showBasedOnDefinedSubjectOnlyIf

open fun <T> showBasedOnDefinedSubjectOnlyIf(expect: Expect<T>, predicate: (T) -> Boolean): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep>

Defines that the failure hint shall be shown if the subject is defined and the given predicate holds for it

showBasedOnSubjectOnlyIf

open fun <T> showBasedOnSubjectOnlyIf(expect: Expect<T>, showSubStep: DescriptiveAssertionWithFailureHint.ShowSubjectDefinedOption<T>.() -> Pair<() -> Boolean, (T) -> Boolean>): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep>

Defines that the failure hint shall only be shown based on a predicate influenced by the subject of the expectation.

showOnlyIf

abstract fun showOnlyIf(predicate: () -> Boolean): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep>

Defines that the failure hint shall only be shown if the given predicate holds.

showOnlyIfSubjectDefined

open fun <T> showOnlyIfSubjectDefined(expect: Expect<T>): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep>

Defines that the failure hint shall be shown in any case as long as the subject is defined

Companion Object Functions

create

fun create(test: () -> Boolean, failureHintFactory: () -> Assertion): DescriptiveAssertionWithFailureHint.ShowOption