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

ContainsAssertionCreator

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

Represents the base class for Contains.Creators, providing a template to fulfill its job.

Parameters

T - The type of the AssertionPlant.subject.

S - The type of the search criteria.

C - The type of the checkers in use (typically a sub interface of Contains.Checker).

Constructors

<init>

ContainsAssertionCreator(checkers: List<C>)

Represents the base class for Contains.Creators, providing a template to fulfill its job.

Functions

createAssertionGroup

fun createAssertionGroup(plant: AssertionPlant<T>, searchCriteria: List<S>): AssertionGroup

Creates an AssertionGroup representing the sophisticated contains assertion for the given plant based on the given searchCriteria.

fun createAssertionGroup(plant: AssertionPlant<T>, searchCriterion: S, otherSearchCriteria: Array<out S>): AssertionGroup

createAssertionGroupForSearchCriteriaAssertions

abstract 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

abstract fun searchAndCreateAssertion(plant: AssertionPlant<T>, searchCriterion: S, featureFactory: (numberOfOccurrences: Int, description: 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.

Inheritors

ContainsObjectsAssertionCreator

abstract class ContainsObjectsAssertionCreator<T : Any, S, B : SearchBehaviour, C : Checker> : ContainsAssertionCreator<T, S, C>

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

IterableContainsInAnyOrderEntriesAssertionCreator

open class IterableContainsInAnyOrderEntriesAssertionCreator<E : Any, T : Iterable<E?>> : ContainsAssertionCreator<T, AssertionPlant<E>.() -> Unit, Checker>, Creator<T, AssertionPlant<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.