doc / ch.tutteli.atrium / newCheckLazilyAtTheEnd

newCheckLazilyAtTheEnd

inline fun <T : Any> IAtriumFactory.newCheckLazilyAtTheEnd(assertionVerb: ITranslatable, subject: T, reporter: IReporter, createAssertions: IAssertionPlant<T>.() -> Unit): IAssertionPlant<T>

Use this function to create a custom assertion verb which lazy evaluates assertions (see IAtriumFactory.newCheckLazily).

This function will create an IAssertionPlant which does not check the created assertions until one calls IAssertionPlant.checkAssertions. However, it uses the given createAssertions function immediately after creating the IAssertionPlant which might add some assertions and it then calls IAssertionPlant.checkAssertions. In case all assertions added so far hold, then it will not evaluate further added assertions until one calls IAssertionPlant.checkAssertions again.

It creates a IAtriumFactory.newThrowingAssertionChecker based on the given reporter for assertion checking.

Exceptions

AssertionError - The newly created IAssertionPlant might throw an AssertionError in case a created IAssertion does not hold.

Return
The newly created IAssertionPlant which can be used to postulate further assertions.