infix fun <T : CharSequence> CharSequenceContains.CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
(source)
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.
expected
- The value which is expected to be contained within the input of the search.
IllegalArgumentException
- in case expected is not a CharSequence, Number or Char.
Return
an Expect for the subject of this
expectation.
@JvmName("valueIgnoringCase") infix fun <T : CharSequence> CharSequenceContains.CheckerStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
(source)
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.
expected
- The value which is expected to be contained within the input of the search.
IllegalArgumentException
- in case expected is not a CharSequence, Number or Char.
Return
an Expect for the subject of this
expectation.
infix fun <T : CharSequence> CharSequenceContains.EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T>
(source)
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.
expected
- The value which is expected to be contained within the input of the search.
IllegalArgumentException
- in case expected is not a CharSequence, Number or Char.
Return
an Expect for the subject of this
expectation.
fun <T> value(value: T): Value<T>
(source)
Helper function to create a Value based on the given value.
infix fun <E, T> IterableLikeContains.CheckerStep<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T>
(source)
Finishes the specification of the sophisticated contains
assertion where the subject (an IterableLike)
needs to contain the expected value.
Delegates to the values(expected)
.
expected
- The value which is expected to be contained within this IterableLike.
Return
an Expect for the subject of this
expectation.
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>
(source)
Finishes the specification of the sophisticated contains
assertion where the subject (an IterableLike)
needs to contain only the expected value.
Delegates to the values(expected)
.
expected
- The value which is expected to be contained within the IterableLike.
Return
an Expect for the subject of this
expectation.
infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>
(source)
Finishes the specification of the sophisticated contains
assertion where the subject (an IterableLike)
needs to contain only the expected value.
Delegates to the values(expected)
.
expected
- The value which is expected to be contained within the IterableLike.
Return
an Expect for the subject of this
expectation.
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>
(source)
Expects that the property Map.Entry.value of the subject of this
expectation
holds all assertions the given assertionCreator creates for it and
returns an Expect for the current subject of this
expectation.
val entry = mapOf(1 to "a").entries.first()
expect(entry) value { // subject inside this block is of type String (actually "a")
this toEqual "a"
} // subject here is back to type Map.Entry<Int, String>
fails { // because "a" is not equal to "b"
expect(entry) value { // subject inside this block is of type String (actually "a")
this toEqual "b"
}
}
Return
an Expect for the subject of this
expectation.
val <V, T : Entry<*, V>> Expect<T>.value: Expect<V>
(source)
Creates an Expect for the property Map.Entry.value of the subject of this
expectation,
so that further fluent calls are assertions about it.
val entry = mapOf(1 to "a").entries.first()
expect(entry).value toEqual "a"
// | | subject here is of type String (actually "a")
// | subject here is of type Map.Entry<Int, String>
fails { // because "a" is not equal to "b"
expect(entry).value toEqual "b"
// | | subject here is of type String (actually "a")
// | subject here is of type Map.Entry<Int, String>
}
Return
The newly created Expect for the extracted feature.