doc / ch.tutteli.atrium.assertions.builders / AssertionsOption

AssertionsOption

interface AssertionsOption<out T : AssertionGroupType, R> (source)

Option step which allows to specify AssertionGroup.assertions.

Properties

description

abstract val description: Translatable

The previously defined AssertionGroup.description.

groupType

abstract val groupType: T

The previously defined AssertionGroup.type.

representation

abstract val representation: Any

The previously defined AssertionGroup.representation.

Functions

withAssertion

open fun withAssertion(assertion: Assertion): R

Uses the given assertion as single AssertionGroup.assertions.

withAssertions

open fun withAssertions(assertion1: Assertion, assertion2: Assertion): R

Uses the given assertion1 and assertion2 as AssertionGroup.assertions.

open fun withAssertions(assertion1: Assertion, assertion2: Assertion, assertion3: Assertion): R

Uses the given assertion1, assertion2 and assertion3 as AssertionGroup.assertions.

abstract fun withAssertions(assertions: List<Assertion>): R

Uses the given assertions as AssertionGroup.assertions.

Companion Object Functions

asFactoryWithDefaultFinalStep

fun <T : AssertionGroupType> asFactoryWithDefaultFinalStep(): (T, Translatable, Any) -> AssertionsOption<T, BasicAssertionGroupFinalStep>

create

fun <T : AssertionGroupType, R> create(groupType: T, description: Translatable, representation: Any, factory: (T, Translatable, Any, List<Assertion>) -> R): AssertionsOption<T, R>

withDefaultFinalStepAndEmptyDescriptionAndRepresentation

fun <T : AssertionGroupType> withDefaultFinalStepAndEmptyDescriptionAndRepresentation(groupType: T): AssertionsOption<T, BasicAssertionGroupFinalStep>

withEmptyDescriptionAndRepresentation

fun <T : AssertionGroupType, R> withEmptyDescriptionAndRepresentation(groupType: T, factory: (T, Translatable, Any, List<Assertion>) -> R): AssertionsOption<T, R>

Extension Functions

withExplanatoryAssertion

fun <T : ExplanatoryAssertionGroupType> AssertionsOption<T, ExplanatoryAssertionGroupFinalStep>.withExplanatoryAssertion(translatable: Translatable): ExplanatoryAssertionGroupFinalStep

Creates the AssertionGroup with the previously specified AssertionsOption.groupType using the given translatable to create an ExplanatoryAssertion which is used as single Assertion in AssertionGroup.assertions.

withExplanatoryAssertions

fun <T : ExplanatoryAssertionGroupType> AssertionsOption<T, ExplanatoryAssertionGroupFinalStep>.withExplanatoryAssertions(translatable: Translatable, arg: Any, vararg otherArgs: Any): ExplanatoryAssertionGroupFinalStep

Creates the AssertionGroup with the previously specified AssertionsOption.groupType using the given translatable -- which is used in an TranslatableWithArgs together with the given arguments (arg and optionally otherArgs) -- to create an ExplanatoryAssertion which is used as single Assertion in AssertionGroup.assertions.