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

the

infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.the(values: Values<Any>): Expect<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 Expect 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>): Expect<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 Expect for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.the(values: Values<Any>): Expect<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 Expect for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.the(patterns: RegexPatterns): Expect<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 Expect for which the assertion was built to support a fluent API.

@JvmName("regexIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<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 Expect for which the assertion was built to support a fluent API.

infix fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<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.

Delegates to atLeast 1 the patterns.

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 Expect for which the assertion was built to support a fluent API.