doc / ch.tutteli.atrium.assertions.charsequence.contains.creators / CharSequenceContainsAssertionCreator

CharSequenceContainsAssertionCreator

class CharSequenceContainsAssertionCreator<T : CharSequence, S : SearchBehaviour> : ContainsObjectsAssertionCreator<T, Any, S, Checker>, Creator<T, Any> (source)
Deprecated: Please open an issue if you used this class; will be removed with 1.0.0

Represents a creator of sophisticated contains assertions for CharSequence.

A sophisticated contains assertion is build up by a desired SearchBehaviour, a Searcher and a number of Checkers. The searcher searches for specified objects -- considering the given searchBehaviour -- and then passes on the result to the given checkers which in turn create the assertions representing the corresponding check. Those created assertions are then grouped into an AssertionGroup which represents the sophisticated assertion as a whole.

Parameters

T - The type of the AssertionPlant.subject for which the contains assertion is be build.

S - The search behaviour which should be applied to the input of the search.

Constructors

<init>

CharSequenceContainsAssertionCreator(searchBehaviour: S, searcher: Searcher<S>, checkers: List<Checker>)

Represents a creator for sophisticated contains assertions for CharSequence.

Properties

descriptionContains

val descriptionContains: DescriptionCharSequenceAssertion

Provides the translation for contains.

descriptionNumberOfOccurrences

val descriptionNumberOfOccurrences: DescriptionCharSequenceAssertion

Provides the translation for number of occurrences.

Functions

search

fun search(plant: AssertionPlant<T>, searchCriterion: Any): Int

Searches for something matching the given searchCriterion in the given plant's subject and returns the number of occurrences.

Inherited Functions

createAssertionGroupForSearchCriteriaAssertions

fun createAssertionGroupForSearchCriteriaAssertions(assertions: List<Assertion>): AssertionGroup

Creates an AssertionGroup representing the sophisticated contains assertion as a whole based on the given assertions which where created for the search criteria.

searchAndCreateAssertion

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.