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

InAnyOrderEntriesAssertionCreator

class InAnyOrderEntriesAssertionCreator<E : Any, T> : ContainsAssertionCreator<T, List<E?>, (Expect<E>.() -> Unit)?, IterableLikeContains.Checker>, IterableLikeContains.Creator<T, (Expect<E>.() -> Unit)?> (source)

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.

Parameters

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

Constructors

<init>

InAnyOrderEntriesAssertionCreator(converter: (T) -> Iterable<E?>, 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 holding a group of assertions, created by an assertion creator lambda.

Properties

descriptionContains

val descriptionContains: Translatable

Provides the translation for contains.

descriptionNotFound

val descriptionNotFound: Translatable

Provides the translation for when an item is not found in a toContain.atLeast(1) check.

descriptionNumberOfElementsFound

val descriptionNumberOfElementsFound: Translatable

Provides the translation for and N such elements were found when an item is not found in a toContain.atLeast(1) check.

descriptionToContain

val descriptionToContain: Translatable

Provides the translation for to contain.

Inherited Properties

searchBehaviour

val searchBehaviour: Contains.SearchBehaviour

Functions

decorateInAnyOrderAssertion

fun decorateInAnyOrderAssertion(inAnyOrderAssertion: AssertionGroup, multiConsumableContainer: AssertionContainer<List<E?>>): AssertionGroup

Override in a subclass if you want to decorate the assertion.

makeSubjectMultipleTimesConsumable

fun makeSubjectMultipleTimesConsumable(container: AssertionContainer<T>): AssertionContainer<List<E?>>

Make the underlying subject multiple times consumable.

searchAndCreateAssertion

fun searchAndCreateAssertion(multiConsumableContainer: AssertionContainer<List<E?>>, searchCriterion: (Expect<E>.() -> Unit)?, featureFactory: (Int, 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.

Inherited 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.