doc / ch.tutteli.atrium.assertions.builders

Package ch.tutteli.atrium.assertions.builders

The AssertionBuilder and other builders to ease the creation of Assertions.

Types

AssertionBuilder

interface AssertionBuilder

Represents a builder which creates Assertions and AssertionGroups.

AssertionBuilderFinalStep

interface AssertionBuilderFinalStep<T : Assertion>

Final step in the AssertionBuilder process, creates the desired Assertion of type T.

AssertionGroupDescriptionAndEmptyRepresentationOption

interface AssertionGroupDescriptionAndEmptyRepresentationOption<out T : AssertionGroupType, R>

Option step which allows to specify the AssertionGroup.description -- RawString.EMPTY is used as AssertionGroup.representation.

AssertionGroupDescriptionAndRepresentationOption

interface AssertionGroupDescriptionAndRepresentationOption<out T : AssertionGroupType, R>

Option step which allows to specify AssertionGroup.description and AssertionGroup.representation.

AssertionsOption

interface AssertionsOption<out T : AssertionGroupType, R>

Option step which allows to specify AssertionGroup.assertions.

BasicAssertionGroupFinalStep

interface BasicAssertionGroupFinalStep : AssertionBuilderFinalStep<AssertionGroup>

Final step which creates an AssertionGroup with the previously defined groupType, description, representation and assertions.

DescriptiveAssertionFinalStep

interface DescriptiveAssertionFinalStep : AssertionBuilderFinalStep<DescriptiveAssertion>

Final step which creates a DescriptiveAssertion based on the previously defined test, description and representation.

DescriptiveAssertionHoldsOption

interface DescriptiveAssertionHoldsOption

Option step which allows to specify DescriptiveAssertion.holds.

DescriptiveLikeAssertionDescriptionOption

interface DescriptiveLikeAssertionDescriptionOption<R>

Option step which allows to specify the description of a descriptive like assertion (such as DescriptiveAssertion).

ExplanatoryAssertionExplanationOption

interface ExplanatoryAssertionExplanationOption

Option step which allows to specify ExplanatoryAssertion.explanation.

ExplanatoryAssertionFinalStep

interface ExplanatoryAssertionFinalStep : AssertionBuilderFinalStep<ExplanatoryAssertion>

Final step which creates an ExplanatoryAssertion based on the previously defined explanation.

ExplanatoryAssertionGroupFinalStep

interface ExplanatoryAssertionGroupFinalStep : AssertionBuilderFinalStep<AssertionGroup>

Final step which creates an AssertionGroup with an ExplanatoryAssertionGroupType based on the previously defined groupType and the explanatoryAssertions.

ExplanatoryAssertionGroupTypeOption

interface ExplanatoryAssertionGroupTypeOption

Option step which allows to specify what ExplanatoryAssertionGroupType is used as AssertionGroup.type.

Type Aliases

DefaultAssertionGroupBuilderOptions

typealias DefaultAssertionGroupBuilderOptions<T> = AssertionGroupDescriptionAndRepresentationOption<T, AssertionsOption<T, BasicAssertionGroupFinalStep>>

Properties

assertionBuilder

val assertionBuilder: AssertionBuilder

Returns the AssertionBuilder.

invisibleGroup

val AssertionBuilder.invisibleGroup: AssertionsOption<InvisibleAssertionGroupType, BasicAssertionGroupFinalStep>

Builder to create an AssertionGroup with an InvisibleAssertionGroupType -- use it only if you have several independent Assertions which should be evaluated together.

root

val AssertionBuilder.root: DefaultAssertionGroupBuilderOptions<RootAssertionGroupType>

Builder to create the root AssertionGroup -- do not use it in assertion functions; this group should only be created by AssertionCheckers.

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.