doc / ch.tutteli.atrium.logic.creating.iterable.contains.creators.impl / InAnyOrderValuesAssertionCreator

InAnyOrderValuesAssertionCreator

class InAnyOrderValuesAssertionCreator<SC, T> : ContainsObjectsAssertionCreator<T, List<SC>, SC, InAnyOrderSearchBehaviour, IterableLikeContains.Checker>, IterableLikeContains.Creator<T, SC>

Represents a creator of a sophisticated contains assertions for Iterable where an expected entry can appear in any order and is identified by expected objects (equality comparison).

Parameters

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

SC - The type of the elements of the iterable, used as search criteria.

Constructors

<init>

InAnyOrderValuesAssertionCreator(converter: (T) -> Iterable<SC>, searchBehaviour: InAnyOrderSearchBehaviour, checkers: List<IterableLikeContains.Checker>)

Represents a creator of a sophisticated contains assertions for Iterable where expected entries can appear in any order and are identified by expected objects (equality comparison).

Properties

descriptionContains

val descriptionContains: Translatable

Provides the translation for contains.

descriptionNumberOfOccurrences

val descriptionNumberOfOccurrences: Translatable

Provides the translation for number of occurrences.

groupDescription

val groupDescription: Translatable

Provides the translation for AssertionGroup.description

Functions

decorateAssertion

fun decorateAssertion(container: AssertionContainer<List<SC>>, featureAssertion: Assertion): List<Assertion>

Either return the given featureAssertion as List or add further assertions.

getAssertionGroupType

fun getAssertionGroupType(): AssertionGroupType

Provides the AssertionGroupType for the resulting AssertionGroup.

makeSubjectMultipleTimesConsumable

fun makeSubjectMultipleTimesConsumable(container: AssertionContainer<T>): AssertionContainer<List<SC>>

Make the underlying subject multiple times consumable.

search

fun search(multiConsumableContainer: AssertionContainer<List<SC>>, searchCriterion: SC): Int

Searches for something matching the given searchCriterion in the subject of the given multiConsumableContainer and returns the number of occurrences.

Inherited Functions

searchAndCreateAssertion

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

Searches for something fulfilling the given searchCriterion in the subject of the assertion 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.