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

AssertionCollectorForExplanation

interface AssertionCollectorForExplanation (source)
Deprecated: Switch from Assert to Expect and use AssertionCollector.collectForComposition instead; will be removed with 1.0.0

Responsible to collect assertions made in a sub-AssertionPlant and intended for explanation.

Functions

collect

open fun <T : Any> collect(warningCannotEvaluate: Translatable, maybeSubject: MaybeSubject<T>, assertionCreator: (CollectingAssertionPlant<T>.() -> Unit)?): List<Assertion>

Collects the Assertion created by assertionCreator and uses the given maybeSubject as CollectingAssertionPlant.subject if it is MaybeSubject.Present.

abstract fun <T, A : BaseAssertionPlant<T, A>, C : BaseCollectingAssertionPlant<T, A, C>> collect(warningCannotEvaluate: Translatable, maybeSubject: MaybeSubject<T>, collectingPlantFactory: (() -> T) -> C, assertionCreator: (C.() -> Unit)?): List<Assertion>

Collects the Assertion created by assertionCreator with the collecting assertion plant created by the given collectingPlantFactory and uses the given maybeSubject as BaseCollectingAssertionPlant.subject if it is MaybeSubject.Present.

collectNullable

open fun <T> collectNullable(warningCannotEvaluate: Translatable, maybeSubject: MaybeSubject<T>, assertionCreator: (CollectingAssertionPlantNullable<T>.() -> Unit)?): List<Assertion>

Collects the Assertion created by assertionCreator and uses the given maybeSubject as CollectingAssertionPlantNullable.subject if it is MaybeSubject.Present.

Inheritors

NonThrowingAssertionCollectorForExplanation

interface NonThrowingAssertionCollectorForExplanation : AssertionCollectorForExplanation

Represents an assertion collector meant for explanation which does not throw in case not a single Assertion was collected.

ThrowingAssertionCollectorForExplanation

interface ThrowingAssertionCollectorForExplanation : AssertionCollectorForExplanation

Represents an assertion collector meant for explanation which throws in case not a single Assertion was collected.