doc / ch.tutteli.atrium.domain.creating.collectors / AssertionCollector

AssertionCollector

interface AssertionCollector (source)

Responsible to collect assertions made in a sub-AssertionPlant.

Functions

collect

open fun <T : Any> collect(plant: AssertionPlant<T>, assertionCreator: CollectingAssertionPlant<T>.() -> Unit): AssertionGroup
open fun <T : Any> collect(subjectProvider: () -> T, assertionCreator: CollectingAssertionPlant<T>.() -> Unit): AssertionGroup

Use this function if you want to make Assertion about a feature or you perform a type transformation or any other action which results in a sub-AssertionPlant being created and you do not require this resulting plant.

abstract fun <T, A : BaseAssertionPlant<T, A>, C : BaseCollectingAssertionPlant<T, A, C>> collect(subjectProvider: () -> T, collectingPlantFactory: (() -> T) -> C, assertionCreator: C.() -> Unit): AssertionGroup

Use this function if you want to make Assertion about a feature or you perform a type transformation or any other action which results in a sub-BaseAssertionPlant being created and you do not require this resulting plant.

collectNullable

open fun <T> collectNullable(plant: AssertionPlantNullable<T>, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup
open fun <T> collectNullable(subjectProvider: () -> T, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup

Use this function if you want to make Assertion about a feature or you perform a type transformation or any other action which results in a sub-AssertionPlantNullable being created and you do not require this resulting plant.

collectNullableOrExplain

open fun <T> collectNullableOrExplain(safeToCollect: Boolean, warningCannotEvaluate: Translatable, plant: AssertionPlantNullable<T>, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup
open fun <T> collectNullableOrExplain(safeToCollect: Boolean, warningCannotEvaluate: Translatable, subjectProvider: () -> T, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup

Depending on the given safeToCollect it either AssertionCollector.collects the assertions the given assertionCreator might create or it uses it to create an AssertionGroup with an ExplanatoryAssertionGroupType.

collectOrExplain

open fun <T : Any> collectOrExplain(safeToCollect: Boolean, warningCannotEvaluate: Translatable, plant: AssertionPlant<T>, assertionCreator: CollectingAssertionPlant<T>.() -> Unit): AssertionGroup
open fun <T : Any> collectOrExplain(safeToCollect: Boolean, warningCannotEvaluate: Translatable, subjectProvider: () -> T, assertionCreator: CollectingAssertionPlant<T>.() -> Unit): AssertionGroup

Depending on the given safeToCollect it either AssertionCollector.collects the assertions the given assertionCreator might create or it uses it to create an AssertionGroup with an ExplanatoryAssertionGroupType.

abstract fun <T, A : BaseAssertionPlant<T, A>, C : BaseCollectingAssertionPlant<T, A, C>> collectOrExplain(safeToCollect: Boolean, warningCannotEvaluate: Translatable, subjectProvider: () -> T, collectingPlantFactory: (() -> T) -> C, assertionCreator: C.() -> Unit): AssertionGroup

Depending on the given safeToCollect it either AssertionCollector.collects the assertions the given assertionCreator might create or it uses it to create an AssertionGroup with an ExplanatoryAssertionGroupType.

Inheritors

AssertionCollectorBuilder

object AssertionCollectorBuilder : AssertionCollector

Delegates inter alia to the implementation of AssertionCollector. In detail, it implements AssertionCollector by delegating to assertionCollector which in turn delegates to the implementation via loadSingleService.