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

ShowOption

interface ShowOption (source)

Option which allows to specify 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(subjectProvider: SubjectProvider<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(subjectProvider: SubjectProvider<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 assertion.

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(subjectProvider: SubjectProvider<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