doc / ch.tutteli.atrium.logic.creating.basic.contains.creators.impl / ContainsAssertionCreator

ContainsAssertionCreator

abstract class ContainsAssertionCreator<T : Any, TT : Any, in SC, C : Contains.Checker> : Contains.Creator<T, SC> (source)

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

Parameters

T - The type of the subject of this expectation.

TT - The type of the subject of this expectation after making it multiple times consumable.

SC - The type of the search criteria.

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

Constructors

<init>

ContainsAssertionCreator(searchBehaviour: Contains.SearchBehaviour, checkers: List<C>)

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

Properties

descriptionContains

abstract val descriptionContains: Translatable

Provides the translation for contains.

searchBehaviour

val searchBehaviour: Contains.SearchBehaviour

Functions

createAssertionGroup

fun createAssertionGroup(container: AssertionContainer<T>, searchCriteria: List<SC>): AssertionGroup

Creates an AssertionGroup representing the sophisticated contains assertion for the subject of the given container, based on the given searchCriteria.

makeSubjectMultipleTimesConsumable

abstract fun makeSubjectMultipleTimesConsumable(container: AssertionContainer<T>): AssertionContainer<TT>

Make the underlying subject multiple times consumable.

searchAndCreateAssertion

abstract fun searchAndCreateAssertion(multiConsumableContainer: AssertionContainer<TT>, searchCriterion: SC, featureFactory: (numberOfOccurrences: Int, description: Translatable) -> AssertionGroup): AssertionGroup

Searches for something fulfilling the given searchCriterion in the subject of this expectation associated with the given multiConsumableContainer 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, TT : Any, in SC, S : Contains.SearchBehaviour, C : Contains.Checker> : ContainsAssertionCreator<T, TT, SC, C>

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

InAnyOrderEntriesAssertionCreator

class InAnyOrderEntriesAssertionCreator<E : Any, T> : ContainsAssertionCreator<T, List<E?>, (Expect<E>.() -> Unit)?, IterableLikeContains.Checker>, IterableLikeContains.Creator<T, (Expect<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.