open fun <T> collect(expect: Expect<T>, assertionCreator: Expect<T>.() -> Unit): Assertion
(source)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)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.
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.
IllegalArgumentException
- in case the given assertionCreator did not create a single
assertion.
Return
The collected assertions as an AssertionGroup with an InvisibleAssertionGroupType.