doc / ch.tutteli.atrium / IAtriumFactory / newReportingPlantAndAddAssertionsCreatedBy

newReportingPlantAndAddAssertionsCreatedBy

open fun <T : Any> newReportingPlantAndAddAssertionsCreatedBy(assertionVerb: ITranslatable, subject: T, reporter: IReporter, assertionCreator: IAssertionPlant<T>.() -> Unit): IAssertionPlant<T>

Creates an IReportingAssertionPlant which IAssertionPlant.addAssertionsCreatedBy the given assertionCreator lambda where the created IAssertions are added as a group and usually (depending on the configured IReporter) reported as a whole.

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

Parameters

assertionVerb - The assertion verb which will be used inter alia in reporting (see IAssertionPlantWithCommonFields.CommonFields.assertionVerb). subject - The subject for which this plant will create/check IAssertions. (see IAssertionPlantWithCommonFields.CommonFields.subject). reporter - The reporter which will be use for a newThrowingAssertionChecker. assertionCreator - The

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.