doc / ch.tutteli.atrium.api.cc.infix.en_UK / the

the

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>.the(values: Values<Any>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the given values shall be searched, using a non disjoint search.

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed (this function expects Any for your convenience, so that you can mix String and Int for instance).

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'a' and Values.expected is defined as 'a' and one Values.otherExpected is defined as 'a' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain exactly 2 the value 'a' instead of: to contain atLeast 1 the Values('a', 'a')

Parameters

values - The objects which are expected to be contained within the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct. IllegalArgumentException - in case one of the values is not a CharSequence, Number or Char.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>.the(values: Values<Any>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the values shall be searched (ignoring case), using a non disjoint search.

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed (this function expects Any for your convenience, so that you can mix String and Int for instance).

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'a' and Values.expected is defined as 'a' and one Values.otherExpected is defined as 'a' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain ignoring case exactly 2 the value 'a' instead of: to contain ignoring case atLeast 1 the Values('a', 'a')

Parameters

values - The objects which are expected to be contained within the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct. IllegalArgumentException - in case one of the values is not a CharSequence, Number or Char.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>.the(translatables: DefaultTranslationsOf): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the getDefault representation of the given translatables shall be searched, using a non disjoint search.

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'a' and the default translation of DefaultTranslationsOf.expected is defined as 'a' and one default translation of the DefaultTranslationsOf.otherExpected is defined as 'a' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain exactly 2 the defaultTranslationOf IS instead of: to contain atLeast 1 the DefaultTranslationsOf(IS, IS)

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>.the(translatables: DefaultTranslationsOf): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the getDefault representation of the given translatables shall be searched (ignoring case), using a non disjoint search.

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'a' and Values.expected is defined as 'a' and one Values.otherExpected is defined as 'a' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain ignoring case exactly 2 the defaultTranslatableOf IS instead of: to contain ignoring case atLeast 1 the DefaultTranslationsOf(IS, IS)

Parameters

translatables - The objects which are expected to be contained within the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>.the(patterns: RegexPatterns): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression patterns are expected to have a match, using a non disjoint search.

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'ab' and RegexPatterns.pattern is defined as 'a(b)?' and one of the RegexPatterns.otherPatterns is defined as 'a(b)?' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain exactly 2 the regex 'a(b)?' instead of: to contain atLeast 1 the RegexPatterns('a(b)?', 'a(b)?')

Parameters

patterns - The patterns which are expected to have a match against the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression patterns are expected to have a match (ignoring case), using a non disjoint search.

By non disjoint is meant that 'aa' in 'aaaa' is found three times and not only two times. Also notice, that it does not search for unique matches. Meaning, if the input of the search is 'ab' and RegexPatterns.pattern is defined as 'a(b)?' and one of the RegexPatterns.otherPatterns is defined as 'a(b)?' as well, then both match, even though they match the same sequence in the input of the search. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain ignoring case exactly 2 the regex 'a(b)?' instead of: to contain ignoring case atLeast 1 the RegexPatterns('a(b)?', 'a(b)?')

Parameters

patterns - The patterns which are expected to have a match against the input of the search.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected values shall be searched within the Iterable.

Delegates to the Objects(values).

Parameters

values - The values which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected objects shall be searched within the iterable.

Notice, that it does not search for unique matches. Meaning, if the iterable is setOf('a', 'b') and Objects.expected is defined as 'a' and one Objects.otherExpected is defined as 'a' as well, then both match, even though they match the same entry. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: to contain inAny order exactly 2 `object` 'a' instead of: to contain inAny order exactly 1 the Objects('a', 'a')

Parameters

objects - The objects which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E : Any, T : Iterable<E>> IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>.the(entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where an entry shall be searched which holds all assertions Entries.assertionCreator might create and search for entries which hold (one by one) the assertions created by the Entries.otherAssertionCreators.

Parameters

entries - The method object which contains the identification lambdas.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected values need to be contained in Iterable where it does not matter in which order.

Delegates to the Objects(values).

Parameters

values - The values which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected objects need to be contained in Iterable where it does not matter in which order.

Parameters

objects - The objects which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E : Any, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>.the(entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the entry needs to be contained in the Iterable which holds all assertions Entries.assertionCreator might create -- equally an entry for each further Entries.otherAssertionCreators needs to be contained in the Iterable where it does not matter in which order the entries appear.

Notice, that a first-wins strategy applies which means your Entries.assertionCreator functions -- which kind of serve as identification functions -- should be ordered in such a way that the most specific identification function appears first, not that a less specific function wins. For instance, given a setOf(1, 2) you should not search for entries({ isGreaterThan(0) }, { toBe(1) }) but for entries({ toBe(1) }, { isGreaterThan(0) }) otherwise isGreaterThan(0) matches 1 before toBe(1) would match it. As a consequence toBe(1) could only match the entry which is left -- in this case 2 -- and of course this would fail.

Parameters

entries - The method object containing the identification lambdas.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected values need to be contained in Iterable in the specified order.

Delegates to the Objects(values).

Parameters

values - The values which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected objects need to be contained in Iterable in the specified order.

Parameters

objects - The value which are expected to be contained within the Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

infix fun <E : Any, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>.the(entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the entry needs to be contained in the Iterable which holds all assertions Entries.assertionCreator might create -- equally an entry for each further Entries.otherAssertionCreators, following the specified order, needs to be contained in the Iterable

Parameters

entries - The method object containing the identification lambdas.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.