doc / ch.tutteli.atrium.logic / collectForCompositionBasedOnSubject


inline fun <T> AssertionContainer<*>.collectForCompositionBasedOnSubject(maybeSubject: Option<T>, noinline assertionCreator: Expect<T>.() -> Unit): List<Assertion> (source)

Use this function if you want to collect Assertions and use it as part of another Assertion (e.g. as part of an AssertionGroup).

Note that an assertion will be added which fails in case assertionCreator does not create a single assertion.


assertionCreator - A lambda which defines the expectations for the AssertionContainer.maybeSubject.

The collected assertions as a List<[Assertion]>.