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')
values
- The objects which are expected to be contained within the input of the search.
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
An Expect for the current subject of the assertion.
@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')
values
- The objects which are expected to be contained within the input of the search.
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
An Expect for the current subject of the assertion.
infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.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)
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
@JvmName("defaultTranslationsOfIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.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)
translatables
- The objects which are expected to be contained within the input of the search.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
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
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)?')
patterns
- The patterns which are expected to have a match against the input of the search.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
@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
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)?')
patterns
- The patterns which are expected to have a match against the input of the search.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
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')
values
- The values which are expected to be contained within the Iterable.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
fun <E, T : Iterable<E>> the(checkerBuilder: IterableContainsCheckerBuilder<E, T, InAnyOrderSearchBehaviour>, values: Values<E>): AssertionPlant<T>
infix fun <E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>
fun <E, T : Iterable<E>> the(checkerBuilder: IterableContainsCheckerBuilder<E, T, InAnyOrderSearchBehaviour>, objects: Objects<E>): AssertionPlant<T>
fun <E : Any, T : Iterable<E>> the(checkerBuilder: IterableContainsCheckerBuilder<E, T, InAnyOrderSearchBehaviour>, entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>
fun <E, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InAnyOrderOnlySearchBehaviour>, values: Values<E>): AssertionPlant<T>
infix fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>
fun <E, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InAnyOrderOnlySearchBehaviour>, objects: Objects<E>): AssertionPlant<T>
fun <E : Any, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InAnyOrderOnlySearchBehaviour>, entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>
fun <E, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InOrderOnlySearchBehaviour>, values: Values<E>): AssertionPlant<T>
infix fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.the(objects: Objects<E>): AssertionPlant<T>
fun <E, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InOrderOnlySearchBehaviour>, objects: Objects<E>): AssertionPlant<T>
fun <E : Any, T : Iterable<E>> the(builder: IterableContainsBuilder<E, T, InOrderOnlySearchBehaviour>, entries: Entries<E, Assert<E>.() -> Unit>): AssertionPlant<T>
infix fun <E : Any, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.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.
entries
- The parameter object which contains the identification lambdas.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
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
need to be contained in Iterable where it does not matter in which order.
Delegates to the Values(values)
.
values
- The values which are expected to be contained within the Iterable.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
infix fun <E : Any, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.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.
entries
- The parameter object containing the identification lambdas.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
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 expected values
need to be contained in Iterable in the specified order.
Delegates to the Values(values)
.
values
- The values which are expected to be contained within the Iterable.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.
infix fun <E : Any, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.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
entries
- The parameter object containing the identification lambdas.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
An Expect for the current subject of the assertion.