doc / ch.tutteli.atrium.logic / collect

collect

inline fun <T> AssertionContainer<T>.collect(noinline 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.

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

This basically delegates to AssertionCollector.collect 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 an AssertionGroup with an InvisibleAssertionGroupType.