doc / ch.tutteli.atrium.logic / collectForComposition

collectForComposition

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

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

This basically delegates to AssertionCollector.collectForComposition using the subject of the assertion as maybeSubject.

Parameters

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 a List<[Assertion]>.