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

AssertionCollector

interface AssertionCollector (source)
Deprecated: Use one of the utility functions: collectBasedOnSubject/collectForCompositionBasedOnSubject from atrium-logic; will be removed with 0.17.0

Responsible to collect assertions made in an assertionCreator-lambda.

Functions

collect

open fun <T> collect(expect: Expect<T>, assertionCreator: Expect<T>.() -> Unit): Assertion

Uses the Expect.maybeSubject and delegates to the other overload.

abstract fun <T> collect(maybeSubject: Option<T>, assertionCreator: Expect<T>.() -> Unit): Assertion

Use this function if you want to make Assertions about a feature or you perform a type transformation or any other action which results in an assertion container being created and you do not require this resulting container.

collectForComposition

abstract fun <T> collectForComposition(maybeSubject: Option<T>, assertionCreator: Expect<T>.() -> Unit): List<Assertion>

Use this function if you want to collect Assertions and use it as part of an AssertionGroup.