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

the

infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.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 values 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.

@JvmName("valuesIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.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 values 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> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.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 where each need to be contained at least once.

Delegates to atLeast 1 the value

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 values 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> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.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 patterns.pattern is defined as 'a(b)?' and one of the patterns.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.

@JvmName("regexIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.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 patterns.pattern is defined as 'a(b)?' and one of the patterns.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 <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression patterns are expected to have at least one 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 patterns.pattern is defined as 'a(b)?' and one of the patterns.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>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

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

Notice, that it does not search for unique matches. Meaning, if the iterable is setOf('a', 'b') 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 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 value 'a' instead of: to contain inAny order exactly 1 the Values('a', 'a')

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 : Any, T : Iterable<E?>> IterableContains.CheckerOption<E?, T, InAnyOrderSearchBehaviour>.the(entries: Entries<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where an entry shall be searched which either holds all assertions entries.assertionCreatorOrNull might create or needs to be null in case entries.assertionCreatorOrNull is defined as null -- likewise an entry (can be the same) is searched for each of the entries.otherAssertionCreatorsOrNulls.

Parameters

entries - The parameter 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>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

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

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 : Any, T : Iterable<E?>> IterableContains.Builder<E?, T, InAnyOrderOnlySearchBehaviour>.the(entries: Entries<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where an entry needs to be contained in the Iterable which holds all assertions entries.assertionCreatorOrNull might create or it needs to be null in case entries.assertionCreatorOrNull is defined as null -- likewise an entry for each entries.otherAssertionCreatorsOrNulls needs to be contained in the Iterable where it does not matter in which order the entries appear but only as many entries should be returned by the Iterable as assertion creators are defined.

Notice, that a first-wins strategy applies which means your assertion creator lambdas -- which kind of serve as identification lambdas -- should be ordered in such a way that the most specific identification lambda appears first, not that a less specific lambda 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 parameter 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>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.the(values: Values<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the Iterable needs to contain only the expected values in the specified order.

Parameters

values - The nullable 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 : Any, T : Iterable<E?>> IterableContains.Builder<E?, T, InOrderOnlySearchBehaviour>.the(entries: Entries<E>): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the Iterable needs to contain only an entry which holds all assertions entries.assertionCreatorOrNull might create or is null in case entries.assertionCreatorOrNull is defined as null and likewise a further entry for each entries.otherAssertionCreatorsOrNulls (if given) whereas the entries have to appear in the specified order.

This function will be renamed on the JVM level to the with 1.0.0;

Parameters

entries - The parameter 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>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.the(nullableValues: NullableValues<E>): AssertionPlant<T>
Deprecated: Use `the Values` instead; will be removed with 1.0.0


infix fun <E : Any, T : Iterable<E?>> IterableContains.CheckerOption<E?, T, InAnyOrderSearchBehaviour>.the(nullableEntries: NullableEntries<E>): AssertionPlant<T>
Deprecated: Use `the Entries` instead; will be removed with 1.0.0


infix fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.the(nullableValues: NullableValues<E>): AssertionPlant<T>
Deprecated: Use `the Values` instead; will be removed with 1.0.0


infix fun <E : Any, T : Iterable<E?>> IterableContains.Builder<E?, T, InAnyOrderOnlySearchBehaviour>.the(nullableEntries: NullableEntries<E>): AssertionPlant<T>
Deprecated: Use `the Entries` instead; will be removed with 1.0.0


infix fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.the(nullableValues: NullableValues<E>): AssertionPlant<T>
Deprecated: Use `the Values` instead; will be removed with 1.0.0


infix fun <E : Any, T : Iterable<E?>> IterableContains.Builder<E?, T, InOrderOnlySearchBehaviour>.the(nullableEntries: NullableEntries<E>): AssertionPlant<T>
Deprecated: Use `the Entries` instead; will be removed with 1.0.0