class InAnyOrderValuesAssertionCreator<SC, T> : ContainsObjectsAssertionCreator<T, List<SC>, SC, InAnyOrderSearchBehaviour, IterableLikeContains.Checker>, IterableLikeContains.Creator<T, SC>
(source)
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).
T
- The type of the subject of this expectation for which the contains
assertion is be build.
SC
- The type of the elements of the iterable, used as search criteria.
InAnyOrderValuesAssertionCreator(converter: (T) -> Iterable<SC>, searchBehaviour: InAnyOrderSearchBehaviour, checkers: List<IterableLikeContains.Checker>)
Represents a creator of a sophisticated |
val descriptionContains: Translatable
Provides the translation for |
|
val descriptionNotFound: Translatable
Provides the translation for when an item is not found in a |
|
val descriptionNumberOfElementsFound: Translatable
Provides the translation for |
|
val descriptionNumberOfOccurrences: Translatable
Provides the translation for |
|
val descriptionToContain: Translatable
Provides the translation for |
|
val groupDescription: Translatable
Provides the translation for AssertionGroup.description |
fun decorateInAnyOrderAssertion(inAnyOrderAssertion: AssertionGroup, multiConsumableContainer: AssertionContainer<List<SC>>): AssertionGroup
Override in a subclass if you want to decorate the assertion. |
|
fun makeSubjectMultipleTimesConsumable(container: AssertionContainer<T>): AssertionContainer<List<SC>>
Make the underlying subject multiple times consumable. |
|
fun mismatchesForNotSearchBehaviour(multiConsumableContainer: AssertionContainer<List<SC>>, searchCriterion: SC): List<Assertion>
Override in any subclass that wants to report mismatched elements individually when the searchBehaviour is NotSearchBehaviour |
|
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. |
open fun searchAndCreateAssertion(multiConsumableContainer: AssertionContainer<TT>, searchCriterion: SC, 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. |