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

collect

open fun <T> collect(expect: Expect<T>, assertionCreator: Expect<T>.() -> Unit): Assertion (source)
Deprecated: Use collect from atrium-logic; will be removed with 0.17.0

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

See the other overload for more information.

abstract fun <T> collect(maybeSubject: Option<T>, assertionCreator: Expect<T>.() -> Unit): Assertion (source)
Deprecated: Use collectBasedOnSubject from atrium-logic; will be removed with 0.17.0

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.

Or in other words, you do not want to make further assertions about the resulting subject in the resulting sub assertion container.

Parameters

maybeSubject - Either Some wrapping the subject of the current assertion or None in case a previous subject change was not successful - used as subject for the given assertionCreator.

assertionCreator - A lambda which defines the assertions for the feature.

Exceptions

IllegalArgumentException - in case the given assertionCreator did not create a single assertion.

Return
The collected assertions as an AssertionGroup with an InvisibleAssertionGroupType.