doc / ch.tutteli.atrium.assertions.basic.contains.creators / ContainsAssertionCreator

ContainsAssertionCreator

abstract class ContainsAssertionCreator<T : Any, S, C : IChecker> : ICreator<T, S>

Represents the base class for IContains.ICreators, providing a template to fulfill its job.

Parameters

T - The type of the IAssertionPlant.subject. S - The type of the search criteria. C - The type of the checkers in use (typically a sub interface of IContains.IChecker).

Constructors

<init>

ContainsAssertionCreator(checkers: List<C>)

Represents the base class for IContains.ICreators, providing a template to fulfill its job.

Functions

createAssertionGroup

fun createAssertionGroup(plant: IAssertionPlant<T>, searchCriterion: S, otherSearchCriteria: Array<out S>): IAssertionGroup

Creates an IAssertionGroup representing the sophisticated contains assertion for the given plant based on the given searchCriterion and possibly otherSearchCriteria (might be empty).

createAssertionGroupForSearchCriteriaAssertions

abstract fun createAssertionGroupForSearchCriteriaAssertions(assertions: List<IAssertion>): IAssertionGroup

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

searchAndCreateAssertion

abstract fun searchAndCreateAssertion(plant: IAssertionPlant<T>, searchCriterion: S, featureFactory: (numberOfOccurrences: Int, description: ITranslatable) -> IAssertionGroup): IAssertionGroup

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 IAssertionGroup representing the assertion for a search criteria as a whole.

Inheritors

ContainsObjectsAssertionCreator

abstract class ContainsObjectsAssertionCreator<T : Any, S, B : ISearchBehaviour, C : IChecker> : ContainsAssertionCreator<T, S, C>

Represents the base class for IContains.ICreators which use bare objects as search criteria (matching them with ==).

IterableContainsInAnyOrderEntriesAssertionCreator

class IterableContainsInAnyOrderEntriesAssertionCreator<E : Any, T : Iterable<E>> : ContainsAssertionCreator<T, IAssertionPlant<E>.() -> Unit, IChecker>, ICreator<T, IAssertionPlant<E>.() -> Unit>

Represents a creator of a sophisticated contains assertions for Iterable where an expected entry can appear in any order and is identified by holding a group of assertions, created by an assertion creator lambda.