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

value

infix fun <T : CharSequence> CharSequenceContains.CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>

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

Delegates to the values(expected).

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for 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.

Parameters

expected - The value which is 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 expected is not a CharSequence, Number or Char.

Return
An Expect for the current subject of the assertion.

@JvmName("valueIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
@JvmName("valueIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>

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

Delegates to the values(expected).

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for 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.

Parameters

expected - The value which is 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 expected is not a CharSequence, Number or Char.

Return
An Expect for the current subject of the assertion.

infix fun <T : CharSequence> CharSequenceContains.EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
infix fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value shall be searched (ignoring case), using a non disjoint search where it needs to be contained at least once.

Delegates to atLeast 1 value expected.

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for 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.

Parameters

expected - The value which is 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 expected is not a CharSequence, Number or Char.

Return
An Expect for the current subject of the assertion.

fun <T> value(value: T): Value<T>

Helper function to create a Value based on the given value.

infix fun <E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T>

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

Delegates to the values(expected).

Parameters

expected - The value which is expected to be contained within this Iterable.

Exceptions

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>.value(expected: E): Expect<T>
infix fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the Iterable needs to contain only the expected value.

Delegates to the values(expected).

Note that we might change the signature of this function with the next version which will cause a binary backward compatibility break (see #292 for more information)

Parameters

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

Exceptions

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> IterableLikeContains.CheckerStep<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value shall be searched within the IterableLike.

Delegates to the values(expected).

Parameters

expected - The value which is expected to be contained within this IterableLike.

Exceptions

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

Return
An Expect for the current subject of the assertion.

Since
0.14.0 -- API existed for Iterable but not for IterableLike.

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected value.

Delegates to the values(expected).

Note that we might change the signature of this function with the next version which will cause a binary backward compatibility break (see #292 for more information)

Parameters

expected - The value which is expected to be contained within the IterableLike.

Exceptions

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> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected value.

Delegates to the values(expected).

Note that we might change the signature of this function with the next version which will cause a binary backward compatibility break (see #292 for more information)

Parameters

expected - The value which is expected to be contained within the IterableLike.

Exceptions

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

Return
An Expect for the current subject of the assertion.

Since
0.14.0 -- API existed for Iterable but not for IterableLike.

infix fun <K, V, T : Entry<K, V>> Expect<T>.value(assertionCreator: Expect<V>.() -> Unit): Expect<T>

Expects that the property Map.Entry.value of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

Exceptions

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

Return
An Expect for the current subject of the assertion.

val <V, T : Entry<*, V>> Expect<T>.value: Expect<V>

Creates an Expect for the property Map.Entry.value of the subject of the assertion, so that further fluent calls are assertions about it.

Return
The newly created Expect for the extracted feature.