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

searchAndCreateAssertion

protected fun searchAndCreateAssertion(subjectProvider: SubjectProvider<T>, searchCriterion: S, featureFactory: (Int, Translatable) -> AssertionGroup): AssertionGroup (source)

Overrides ContainsAssertionCreator.searchAndCreateAssertion

Searches for something fulfilling the given searchCriterion in the given subjectProvider'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

subjectProvider - 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.