doc / ch.tutteli.atrium.assertions.iterable.contains.creators / IterableContainsInAnyOrderObjectsAssertionCreator

IterableContainsInAnyOrderObjectsAssertionCreator

class IterableContainsInAnyOrderObjectsAssertionCreator<S, T : Iterable<S>> : ContainsObjectsAssertionCreator<T, S, IterableContainsInAnyOrderSearchBehaviour, Checker>, Creator<T, S>

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 AssertionPlant.subject for which the contains assertion is be build. S - The type of the elements of the iterable, used as search criterion.

Constructors

<init>

IterableContainsInAnyOrderObjectsAssertionCreator(searchBehaviour: IterableContainsInAnyOrderSearchBehaviour, checkers: List<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: DescriptionIterableAssertion

Provides the translation for contains.

descriptionNumberOfOccurrences

val descriptionNumberOfOccurrences: DescriptionIterableAssertion

Provides the translation for number of occurrences.

Functions

search

fun search(plant: AssertionPlant<T>, searchCriterion: S): Int

Searches for something matching the given searchCriterion in the given plant's subject and returns the number of occurrences.

Inherited Functions

createAssertionGroupForSearchCriteriaAssertions

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