open fun <T> collectNullable(plant: AssertionPlantNullable<T>, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup
(source)Use this function if you want to make Assertion about a feature or you perform a type transformation or any other action which results in a sub-AssertionPlantNullable being created and you do not require this resulting plant.
Or in other words, you do not want to make further assertions about the resulting subject in the resulting sub assertion plant.
This function can be useful in several cases. For instance:
plant
- The plant from which the AssertionPlantNullable.subject will be used as subject of the
CollectingAssertionPlantNullable.
assertionCreator
- A lambda which typically creates a sub AssertionPlantNullable and adds
assertions to it. For instance, if you create a feature assertion or a type transformation assertion, you will
typically end up creating a sub assertion plant which delegates created Assertions to the
CollectingAssertionPlantNullable.
IllegalArgumentException
- in case the given assertionCreator did not create a single
assertion, did not pass it to the CollectingAssertionPlantNullable respectively.
Return
The collected assertions as an AssertionGroup with an InvisibleAssertionGroupType.
open fun <T> collectNullable(subjectProvider: () -> T, assertionCreator: CollectingAssertionPlantNullable<T>.() -> Unit): AssertionGroup
(source)Use this function if you want to make Assertion about a feature or you perform a type transformation or any other action which results in a sub-AssertionPlantNullable being created and you do not require this resulting plant.
Or in other words, you do not want to make further assertions about the resulting subject in the resulting sub assertion plant.
This function can be useful in several cases. For instance:
subjectProvider
- Provides the subject which is used as CollectingAssertionPlantNullable.subject.
assertionCreator
- A lambda which typically creates a sub AssertionPlantNullable and adds
assertions to it. For instance, if you create a feature assertion or a type transformation assertion, you will
typically end up creating a sub assertion plant which delegates created Assertions to the
CollectingAssertionPlantNullable.
IllegalArgumentException
- in case the given assertionCreator did not create a single
assertion, did not pass it to the CollectingAssertionPlantNullable respectively.
Return
The collected assertions as an AssertionGroup with an InvisibleAssertionGroupType.