interface Expect<T> : SubjectProvider<T>
(source)
Represents the extension point of Assertion functions and sophisticated builders for subjects of type T.
It is also the base type of all assertion container types (like ReportingAssertionContainer, CollectingAssertionContainer etc.)
Note, do not use SubjectProvider as this interface is only temporary and will most likely be removed without further notice.
T
- The type of the subject of the assertion.
abstract val maybeSubject: Option<T>
Either Some wrapping the subject of an Assertion or None in case a previous subject change could not be carried out. |
|
abstract val
The subject of an Assertion -- deprecated, will be removed with 1.0.0. |
abstract fun addAssertion(assertion: Assertion): Expect<T>
Adds the given assertion to this container. |
|
abstract fun addAssertionsCreatedBy(assertionCreator: Expect<T>.() -> Unit): Expect<T>
Adds the assertions created by the assertionCreator lambda to this container and adds a failing assertion to this container in case the assertionCreator did not create a single assertion. |
|
open fun createAndAddAssertion(description: String, expected: Any?, test: (T) -> Boolean): Expect<T> open fun createAndAddAssertion(description: Translatable, expected: Any?, test: (T) -> Boolean): Expect<T>
Creates a DescriptiveAssertion based on the given description, expected and test and adds it to the container. |
val <T> Expect<T>.and: Expect<T>
Can be used to separate single assertions. |
|
val <T : CharSequence> Expect<T>.contains: CharSequenceContains.Builder<T, NoOpSearchBehaviour>
Creates a CharSequenceContains.Builder based on this Expect which allows to define
more sophisticated |
|
val <T : CharSequence> Expect<T>.containsNot: NotCheckerOption<T, NotSearchBehaviour>
Creates a CharSequenceContains.Builder based on this Expect which allows to define
more sophisticated |
|
val <T : LocalDate> Expect<T>.day: Expect<Int>
Creates an Expect for the property LocalDate.dayOfMonth of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
Creates an Expect for the property LocalDate.getDayOfWeek of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Path> Expect<T>.extension: Expect<String>
Creates an Expect for the property Path.extension (provided via niok) of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Path> Expect<T>.fileName: Expect<String>
Creates an Expect for the property Path.fileNameAsString (provided via niok) of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
Creates an Expect for the property Path.fileNameWithoutExtension (provided via niok) of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <K, T : Pair<K, *>> Expect<T>.first: Expect<K>
Creates an Expect for the property Pair.first of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <K, T : Entry<K, *>> Expect<T>.key: Expect<K>
Creates an Expect for the property Map.Entry.key of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <K, T : Map<out K, *>> Expect<T>.keys: Expect<Set<K>>
Creates an Expect for the property Map.keys of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Throwable> Expect<T>.message: Expect<String>
Expects that the property Throwable.message of the subject of the assertion is not null, creates an Expect for it and returns it. |
|
val <T : LocalDate> Expect<T>.month: Expect<Int>
Creates an Expect for the property LocalDate.monthValue of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Path> Expect<T>.parent: Expect<Path>
Expects that this Path has a parent and creates an Expect for it, so that further fluent calls are assertions about it. |
|
val <V, T : Pair<*, V>> Expect<T>.second: Expect<V>
Creates an Expect for the property Pair.second of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : Collection<*>> Expect<T>.size: Expect<Int>
Creates an Expect for the property Collection.size of the subject of the assertion, so that further fluent calls are assertions about it. |
|
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. |
|
val <V, T : Map<*, V>> Expect<T>.values: Expect<Collection<V>>
Creates an Expect for the property Map.values of the subject of the assertion, so that further fluent calls are assertions about it. |
|
val <T : LocalDate> Expect<T>.year: Expect<Int>
Creates an Expect for the property LocalDate.year of the subject of the assertion, so that further fluent calls are assertions about it. |
fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element and
that every element holds all assertions created by the assertionCreatorOrNull or that all elements are |
|
infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T>
Can be used to create a group of sub assertions when using the fluent API. |
|
fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) contains an entry holding
the assertions created by assertionCreatorOrNull or an entry which is |
|
fun <T : Any> Expect<T>. fun <T : Any> Expect<T>.
Turns this Expect into an Assert so that you can use functions which have not yet been migrated to Expect. |
|
fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(): Expect<Set<Entry<K, V>>>
Turns fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(assertionCreator: Expect<Set<Entry<K, V>>>.() -> Unit): Expect<T>
Turns |
|
fun <E, T : Sequence<E>> Expect<T>.asIterable(): Expect<Iterable<E>>
Turns fun <E, T : Sequence<E>> Expect<T>.asIterable(assertionCreator: Expect<Iterable<E>>.() -> Unit): Expect<T>
Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as Iterable. |
|
fun <E> Expect<out Array<out E>>.asList(): Expect<List<E>>
Turns fun <E> Expect<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<E>> fun Expect<ByteArray>.asList(assertionCreator: Expect<List<Byte>>.() -> Unit): Expect<ByteArray> fun Expect<CharArray>.asList(assertionCreator: Expect<List<Char>>.() -> Unit): Expect<CharArray> fun Expect<ShortArray>.asList(assertionCreator: Expect<List<Short>>.() -> Unit): Expect<ShortArray> fun Expect<IntArray>.asList(assertionCreator: Expect<List<Int>>.() -> Unit): Expect<IntArray> fun Expect<LongArray>.asList(assertionCreator: Expect<List<Long>>.() -> Unit): Expect<LongArray> fun Expect<FloatArray>.asList(assertionCreator: Expect<List<Float>>.() -> Unit): Expect<FloatArray> fun Expect<DoubleArray>.asList(assertionCreator: Expect<List<Double>>.() -> Unit): Expect<DoubleArray> fun Expect<BooleanArray>.asList(assertionCreator: Expect<List<Boolean>>.() -> Unit): Expect<BooleanArray>
Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as List. fun Expect<ByteArray>.asList(): Expect<List<Byte>>
Turns fun Expect<CharArray>.asList(): Expect<List<Char>>
Turns fun Expect<ShortArray>.asList(): Expect<List<Short>>
Turns fun Expect<IntArray>.asList(): Expect<List<Int>>
Turns fun Expect<LongArray>.asList(): Expect<List<Long>>
Turns fun Expect<FloatArray>.asList(): Expect<List<Float>>
Turns fun Expect<DoubleArray>.asList(): Expect<List<Double>>
Turns fun Expect<BooleanArray>.asList(): Expect<List<Boolean>>
Turns |
|
fun <T : File> Expect<T>.asPath(): Expect<Path>
Turns fun <T : File> Expect<T>.asPath(assertionCreator: Expect<Path>.() -> Unit): Expect<T>
Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as Path. |
|
fun <T, R> Expect<T>. |
|
fun <T, R> Expect<T>. |
|
fun <TExpected : Throwable> Expect<out Throwable>.cause(): Expect<TExpected>
Expects that the property Throwable.cause of the subject is a TExpected (the same type or a sub-type), creates an Expect of the TExpected type for it and returns it. fun <TExpected : Throwable> Expect<out Throwable>.cause(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>
Expects that the property Throwable.cause of the subject is a TExpected (the same type or a sub-type) and holds all assertions the given assertionCreator creates for it and returns this assertion container. |
|
fun <T : CharSequence> Expect<T>.contains(expected: Any, vararg otherExpected: Any): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains expected's toString representation and the toString representation of the otherExpected (if given), using a non disjoint search. fun <E, T : Iterable<E>> Expect<T>.contains(expected: E, vararg otherExpected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) contains the expected value and the otherExpected values (if given). fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) contains an entry holding the
assertions created by assertionCreatorOrNull or an entry which is fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) contains an entry holding the
assertions created by assertionCreatorOrNull or an entry which is fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePair: Pair<K, V>, vararg otherPairs: Pair<K, V>): Expect<T>
Expects that the subject of the assertion (a Map) contains a key as defined by keyValuePair's Pair.first with a corresponding value as defined by keyValuePair's Pair.second -- optionally the same assertions are created for the otherPairs. fun <K, V : Any, T : Map<out K, V?>> Expect<T>.contains(keyValue: KeyValue<K, V>, vararg otherKeyValues: KeyValue<K, V>): Expect<T>
Expects that the subject of the assertion (a Map) contains a key as defined by keyValue's KeyValue.key
with a corresponding value which either holds all assertions keyValue's
KeyValue.valueAssertionCreatorOrNull creates or needs to be |
|
fun <E, T : Iterable<E>> Expect<T>.containsElementsOf(expectedIterable: Iterable<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains all elements of expectedIterable. |
|
fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E, vararg otherExpected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only the expected value and the otherExpected values (if given) in the defined order. fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only an entry holding
the assertions created by assertionCreatorOrNull or only one entry which is fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only an entry holding
the assertions created by assertionCreatorOrNull or |
|
fun <E, T : Iterable<E>> Expect<T>.containsExactlyElementsOf(expectedIterable: Iterable<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only elements of expectedIterable in same order |
|
fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T>
Expects that the subject of the assertion (a Map) contains the given key. |
|
fun <T : CharSequence> Expect<T>.containsNot(expected: Any, vararg otherExpected: Any): Expect<T>
Expects that the subject of the assertion (a CharSequence) does not contain expected's toString representation and neither one of the otherExpected's toString representation (if given). fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E, vararg otherExpected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) does not contain the expected value and neither one of the otherExpected values (if given). |
|
fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T>
Expects that the subject of the assertion (a Map) does not contain the given key. |
|
fun <T : CharSequence> Expect<T>.containsRegex(pattern: String, vararg otherPatterns: String): Expect<T> fun <T : CharSequence> Expect<T>.containsRegex(pattern: Regex, vararg otherPatterns: Regex): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression pattern as well as the otherPatterns (if given), using a non disjoint search. |
|
fun <T : LocalDate> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T>
Expects that the property LocalDate.dayOfMonth 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. |
|
fun <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T>
Expects that the property LocalDate.getDayOfWeek 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. |
|
fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T> fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char): Expect<T>
Expects that the subject of the assertion (a CharSequence) does not end with expected. |
|
fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T>
Expects that the subject of the assertion (a Path) does not end with the expected Path; |
|
fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T> fun <T : CharSequence> Expect<T>.endsWith(expected: Char): Expect<T>
Expects that the subject of the assertion (a CharSequence) ends with expected. |
|
fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T>
Expects that the subject of the assertion (a Path) ends with the expected Path. |
|
fun <T : Path> Expect<T>.exists(): Expect<T>
Expects that the subject of the assertion (a Path) exists; meaning that there is a file system entry at the location the Path points to. |
|
fun <T : Path> Expect<T>.existsNot(): Expect<T>
Expects that the subject of the assertion (a Path) does not exist; meaning that there is no file system entry at the location the Path points to. |
|
fun <T, R> Expect<T>. |
|
fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit): Expect<T>
Expects that the property Path.extension (provided via niok) 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. |
|
fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect<T, R>
Extracts the property out of the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the property out of the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R>
Extracts the value which is returned when calling f on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, R> Expect<T>.feature(f: KFunction1<T, R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, A1, R> Expect<T>.feature(f: KFunction2<T, A1, R>, a1: A1): FeatureExpect<T, R>
Extracts the value which is returned when calling f with argument a1 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, A1, R> Expect<T>.feature(f: KFunction2<T, A1, R>, a1: A1, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f with argument a1 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, A1, A2, R> Expect<T>.feature(f: KFunction3<T, A1, A2, R>, a1: A1, a2: A2): FeatureExpect<T, R>
Extracts the value which is returned when calling f with arguments a1, a2 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, A1, A2, R> Expect<T>.feature(f: KFunction3<T, A1, A2, R>, a1: A1, a2: A2, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f with argument a1, a2 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, A1, A2, A3, R> Expect<T>.feature(f: KFunction4<T, A1, A2, A3, R>, a1: A1, a2: A2, a3: A3): FeatureExpect<T, R>
Extracts the value which is returned when calling f with arguments a1, a2, a3 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, A1, A2, A3, R> Expect<T>.feature(f: KFunction4<T, A1, A2, A3, R>, a1: A1, a2: A2, a3: A3, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f with argument a1, a2, a3 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, A1, A2, A3, A4, R> Expect<T>.feature(f: KFunction5<T, A1, A2, A3, A4, R>, a1: A1, a2: A2, a3: A3, a4: A4): FeatureExpect<T, R>
Extracts the value which is returned when calling f with arguments a1, a2, a3, a4 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, A1, A2, A3, A4, R> Expect<T>.feature(f: KFunction5<T, A1, A2, A3, A4, R>, a1: A1, a2: A2, a3: A3, a4: A4, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f with argument a1, a2, a3, a4 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, A1, A2, A3, A4, A5, R> Expect<T>.feature(f: KFunction6<T, A1, A2, A3, A4, A5, R>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): FeatureExpect<T, R>
Extracts the value which is returned when calling f with arguments a1, a2, a3, a4, a5 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, A1, A2, A3, A4, A5, R> Expect<T>.feature(f: KFunction6<T, A1, A2, A3, A4, A5, R>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts the value which is returned when calling f with argument a1, a2, a3, a4, a5 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, R> Expect<T>.feature(description: String, provider: T.() -> R): FeatureExpect<T, R>
Extracts a feature out of the current subject of the assertion based on the given provider and using the given description, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, R> Expect<T>.feature(description: String, provider: T.() -> R, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts a feature out of the current subject of the assertion based on the given provider and using the given description, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>): FeatureExpect<T, R>
Extracts a feature out of the current subject of the assertion, based on the given provider, creates a new Expect for it and returns it so that subsequent calls are based on the feature. fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>
Extracts a feature out of the current subject of the assertion, based on the given provider, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject. |
|
fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit): Expect<T>
Expects that the property Path.fileNameAsString (provided via niok) 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. |
|
fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<String>.() -> Unit): Expect<T>
Expects that the property Path.fileNameWithoutExtension (provided via niok) 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. |
|
fun <K, V, T : Pair<K, V>> Expect<T>.first(assertionCreator: Expect<K>.() -> Unit): Expect<T>
Expects that the property Pair.first 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. |
|
fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E>
Expects that the given index is within the bounds of the subject of the assertion (a List) and returns an Expect for the element at that position. fun <E, T : List<E>> Expect<T>.get(index: Int, assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the given index is within the bounds of the subject of the assertion (a List) and that the element at that position holds all assertions the given assertionCreator creates for it. |
|
fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V>
Expects that the subject of the assertion (a Map) contains the given key, creates an Expect for the corresponding value and returns the newly created assertion container, so that further fluent calls are assertions about it. fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K, assertionCreator: Expect<V>.() -> Unit): Expect<T>
Expects that the subject of the assertion (a Map) contains the given key and that the corresponding value holds all assertions the given assertionCreator creates for it. |
|
fun <E, T : Iterable<E>> Expect<T>.hasNext(): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element. |
|
fun <E, T : Iterable<E>> Expect<T>.hasNotNext(): Expect<T>
Expects that the subject of the assertion (an Iterable) does not have next element. |
|
fun <T : Collection<*>> Expect<T>.hasSize(expected: Int): Expect<T>
Expects that the subject of the assertion (a Collection) has the given expected size. |
|
fun <TSub : Any> Expect<*>.isA(): Expect<TSub>
Expects that the subject of the assertion is a TSub (the same type or a sub-type) and changes the subject to this type. fun <TSub : Any> Expect<*>.isA(assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub>
Expects that the subject of the assertion is a TSub (the same type or a sub-type) and that it holds all assertions the given assertionCreator creates. |
|
fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDate) is after the expected. fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(expected: ChronoLocalDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDateTime) is after the expected. fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(expected: ChronoZonedDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoZonedDateTime) is after the expected. |
|
fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDate): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDate) is after or equal the expected. fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(expected: ChronoLocalDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDateTime) is after or equal the expected. fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(expected: ChronoZonedDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoZonedDateTime) is after or equal the expected. |
|
fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDate) is before the expected. fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(expected: ChronoLocalDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDateTime) is before the expected. fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(expected: ChronoZonedDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoZonedDateTime) is before the expected. |
|
fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDate): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDate) is before or equal the expected. fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDateTime) is before or equal the expected. fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(expected: ChronoZonedDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoZonedDateTime) is before or equals the expected. |
|
fun <T : Path> Expect<T>.isDirectory(): Expect<T>
Expects that the subject of the assertion (a Path) is a directory; meaning that there is a file system entry at the location the Path points to and that is a directory. |
|
fun <T : CharSequence> Expect<T>.isEmpty(): Expect<T>
Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isEmpty. |
|
fun <T : Optional<*>> Expect<T>.isEmpty(): Expect<T>
Expects that the subject of the assertion (an Optional) is empty (not present). |
|
fun <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDate) is equal to the expected. fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isEqual(expected: ChronoLocalDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoLocalDateTime) is equal to the expected. fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(expected: ChronoZonedDateTime<*>): Expect<T>
Expects that the subject of the assertion (a ChronoZonedDateTime) is equal to the expected. |
|
fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<T>
Expects that the subject of the assertion (a BigDecimal) is equal to expected including BigDecimal.scale. |
|
fun <TExpected : Throwable> Expect<out Result<*>>.isFailure(): Expect<TExpected>
Expects that the subject of the assertion (a Result) is a Failure and that it encapsulates an exception of type TExpected. fun <TExpected : Throwable> Expect<out Result<*>>.isFailure(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>
Expects that the subject of the assertion (a Result) is a Failure, it encapsulates an exception of type TExpected and that the exception holds all assertions the given assertionCreator creates. |
|
fun <T : Comparable<T>> Expect<T>.isGreaterThan(expected: T): Expect<T>
Expects that the subject of the assertion is greater than expected. The comparison is carried out with Comparable.compareTo. |
|
fun <T : Comparable<T>> Expect<T>.isGreaterThanOrEqual(expected: T): Expect<T>
Expects that the subject of the assertion is greater than or equal expected. The comparison is carried out with Comparable.compareTo. |
|
fun <K, V, T : Entry<K, V>> Expect<T>.isKeyValue(key: K, value: V): Expect<T>
Expects that the property Map.Entry.key of the subject of the assertion is equal to the given key and the property Map.Entry.value is equal to the given value. |
|
fun <T : Comparable<T>> Expect<T>.isLessThan(expected: T): Expect<T>
Expects that the subject of the assertion is less than expected. The comparison is carried out with Comparable.compareTo. |
|
fun <T : Comparable<T>> Expect<T>.isLessThanOrEqual(expected: T): Expect<T>
Expects that the subject of the assertion is less than or equal expected. The comparison is carried out with Comparable.compareTo. |
|
fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T>
Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotBlank. |
|
fun <T : CharSequence> Expect<T>.isNotEmpty(): Expect<T>
Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotEmpty. |
|
fun <T : BigDecimal> Expect<T>.isNotEqualIncludingScale(expected: T): Expect<T>
Expects that the subject of the assertion (a BigDecimal) is not equal to expected including BigDecimal.scale. |
|
fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expect<T>
Expects that the subject of the assertion (a BigDecimal) is not numerically equal to expected. |
|
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T>
Expects that the subject of the assertion is not the same instance as expected. |
|
fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T>
Expects that the subject of the assertion (a BigDecimal) is numerically equal to expected. |
|
fun <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E>
Expects that the subject of the assertion (an Optional) is present and returns an Expect for the inner type E. fun <E, T : Optional<E>> Expect<T>.isPresent(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the subject of the assertion (an Optional) is present and that it holds all assertions the given assertionCreator creates. |
|
fun <T : Path> Expect<T>.isReadable(): Expect<T>
Expects that the subject of the assertion (a Path) is readable; meaning that there is a file system entry at the location the Path points to and that the current thread has the permission to read from it. |
|
fun <T : Path> Expect<T>.isRegularFile(): Expect<T>
Expects that the subject of the assertion (a Path) is a file; meaning that there is a file system entry at the location the Path points to and that is a regular file. |
|
fun <T> Expect<T>.isSameAs(expected: T): Expect<T>
Expects that the subject of the assertion is the same instance as expected. |
|
fun <E, T : Result<E>> Expect<T>.isSuccess(): Expect<E>
Expects that the subject of the assertion (a Result) is a Success and returns an Expect for the inner type E. fun <E, T : Result<E>> Expect<T>.isSuccess(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the subject of the assertion (a Result) is a Success and that it holds all assertions the given assertionCreator creates. |
|
fun <T : Path> Expect<T>.isWritable(): Expect<T>
Expects that the subject of the assertion (a Path) is writable; meaning that there is a file system entry at the location the Path points to and that the current thread has the permission to write to it. |
|
fun <K, V, T : Entry<K, V>> Expect<T>.key(assertionCreator: Expect<K>.() -> Unit): Expect<T>
Expects that the property Map.Entry.key 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. |
|
fun <K, V, T : Map<out K, V>> Expect<T>.keys(assertionCreator: Expect<Set<K>>.() -> Unit): Expect<T>
Expects that the property Map.keys 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. |
|
fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T>
Expects that the subject of the assertion (a CharSequence) matches the given expected. |
|
fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(): Expect<E>
Creates an Expect for the result of calling fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the result of calling |
|
fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.() -> Unit): Expect<T>
Expects that the property Throwable.message of the subject of the assertion is not null and holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion. |
|
fun <T : Throwable> Expect<T>.messageContains(expected: Any, vararg otherExpected: Any): Expect<T>
Expects that the property Throwable.message of the subject of the assertion is not null and contains expected's toString representation and the toString representation of the otherExpected (if given), using a non disjoint search. |
|
fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(): Expect<E>
Creates an Expect for the result of calling fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the result of calling |
|
fun <T : CharSequence> Expect<T>.mismatches(expected: Regex): Expect<T>
Expects that the subject of the assertion (a CharSequence) mismatches the given expected. |
|
fun <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T>
Expects that the property LocalDate.monthValue 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. |
|
fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) does not contain a single entry
which holds all assertions created by assertionCreatorOrNull or does not contain a single entry which is |
|
fun <T> Expect<T>.notToBe(expected: T): Expect<T>
Expects that the subject of the assertion is not (equal to) expected. |
|
fun <T : Any> Expect<T?>.notToBeNull(): Expect<T>
Expects that the subject of the assertion is not null and changes the subject to the non-nullable version. fun <T : Any> Expect<T?>.notToBeNull(assertionCreator: Expect<T>.() -> Unit): Expect<T>
Expects that the subject of the assertion is not null and that it holds all assertions the given assertionCreator creates. |
|
fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R>
Expects that no Throwable is thrown at all when calling the subject (a lambda with arity 0, i.e. without arguments) and changes the subject of the assertion to the return value of type R. fun <R, T : () -> R> Expect<T>.notToThrow(assertionCreator: Expect<R>.() -> Unit): Expect<R>
Expects that no Throwable is thrown at all when calling the subject (a lambda with arity 0, i.e. without arguments) and that the corresponding return value holds all assertions the given assertionCreator creates. |
|
fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expect<T>
Expects that this Path has a parent, that the parent holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion. |
|
fun <T : Path> Expect<T>.resolve(other: String): Expect<Path>
Expects that other resolves against this Path and creates an Expect for the resolved Path so that further fluent calls are assertions about it. fun <T : Path> Expect<T>.resolve(other: String, assertionCreator: Expect<Path>.() -> Unit): Expect<T>
Expects that other resolves against this Path, that the resolved Path holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion. |
|
fun <K, V, T : Pair<K, V>> Expect<T>.second(assertionCreator: Expect<V>.() -> Unit): Expect<T>
Expects that the property Pair.second 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. |
|
fun <E, T : Collection<E>> Expect<T>.size(assertionCreator: Expect<Int>.() -> Unit): Expect<T>
Expects that the property Collection.size 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. |
|
fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T> fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char): Expect<T>
Expects that the subject of the assertion (a CharSequence) does not start with expected. |
|
fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T>
Expects that the subject of the assertion (a Path) does not start with the expected. |
|
fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T> fun <T : CharSequence> Expect<T>.startsWith(expected: Char): Expect<T>
Expects that the subject of the assertion (a CharSequence) starts with expected. |
|
fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T>
Expects that the subject of the assertion (a Path) starts with the expected. |
|
fun <T> Expect<T>.toBe(expected: T): Expect<T>
Expects that the subject of the assertion is (equal to) expected. fun <T : BigDecimal> Expect<T?>.toBe(expected: Nothing?): Expect<T?>
Expects that the subject of the assertion (a BigDecimal) is |
|
fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(assertionCreatorOrNull: (Expect<T>.() -> Unit)?): Expect<T?>
Expects that the subject of the assertion is either |
|
fun Expect<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): Expect<Float>
Expects that the subject of the assertion (a Float) is equal to expected with an error tolerance (range including bounds). fun Expect<Double>.toBeWithErrorTolerance(expected: Double, tolerance: Double): Expect<Double>
Expects that the subject of the assertion (a Double) is equal to expected with an error tolerance (range including bounds). fun <T : BigDecimal> Expect<T>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): Expect<T>
Expects that the subject of the assertion is equal to expected with an error tolerance (range including bounds). |
|
fun <TExpected : Throwable> Expect<() -> Any?>.toThrow(): Expect<TExpected>
Expects that the thrown Throwable is a TExpected (the same type or a sub-type). fun <TExpected : Throwable> Expect<() -> Any?>.toThrow(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>
Expects that the thrown Throwable is a TExpected (the same type or a sub-type) and that it holds all assertions the given assertionCreator creates. |
|
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. |
|
fun <K, V, T : Map<K, V>> Expect<T>.values(assertionCreator: Expect<Collection<V>>.() -> Unit): Expect<T>
Expects that the property Map.keys 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. |
|
fun <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T>
Expects that the property LocalDate.yearof 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. |
interface CollectingAssertionContainer<T> : Expect<T>
Represents a container for Assertion which is intended to serve as receiver object for lambdas which create Assertions, in which this Expect collects the assertions created this ways. |
|
interface FeatureExpect<T, R> : Expect<R>
Represents an Expect which results due to a change of the Expect.maybeSubject to a feature of the subject. |
|
interface RootExpect<T> : Expect<T>
Represents the root of an Expect chain, intended as extension point for functionality which should only be available on the root. |