doc / ch.tutteli.atrium.assertions.basic.contains.creators / ContainsObjectsAssertionCreator / searchAndCreateAssertion

searchAndCreateAssertion

protected fun searchAndCreateAssertion(plant: AssertionPlant<T>, searchCriterion: S, featureFactory: (Int, Translatable) -> AssertionGroup): AssertionGroup

Searches for something fulfilling the given searchCriterion in the given plant's subject and should pass on the number of occurrences to the given featureFactory which creates feature assertions based on the checkers, which in turn can be used to create a resulting AssertionGroup representing the assertion for a search criteria as a whole.

Parameters

plant - The plant for which the assertion is created. searchCriterion - A search criterion. featureFactory - The feature factory which should be called, passing the number of occurrences (matching the given searchCriterion) including a translation for number of occurrences.

Return
The newly created AssertionGroup.