interface ExpectInternal<T> : Expect<T>, AssertionContainer<T>
Sole purpose of this interface is to hide AssertionContainer from newcomers which usually don't have to deal with this.
Moreover, we separate Expect from AssertionContainer so that we can provide extension functions for AssertionContainer which are more or less identical to the ones defined for api-fluent but don't return Expect but Assertion etc.
See https://github.com/robstoll/atrium-roadmap/wiki/Requirements#personas for more information about the personas.
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. |
|
abstract fun <I : Any> getImpl(kClass: KClass<I>, defaultFactory: () -> I): I
Do not use yet, this is experimental |
val <T> Expect<T>._logic: AssertionContainer<T>
Entry point to the logic level of Atrium -- which is one level deeper than the API -- on which assertion functions do not return Expects but Assertions and the like. |
|
val <T> Expect<T>.and: Expect<T>
Can be used to separate single assertions. |
|
val <T> AssertionContainer<T>.changeSubject: SubjectChangerBuilder.KindStep<T>
Entry point to use the SubjectChangerBuilder based on this AssertionContainer. |
|
val <T> AssertionContainer<T>.extractFeature: FeatureExtractorBuilder.DescriptionStep<T>
Entry point to use the FeatureExtractorBuilder based on this AssertionContainer. |
|
val <T> AssertionContainer<T>.featureExtractor: FeatureExtractor |
|
val <T> Expect<T>.it: Expect<T>
Inline property referring actually to |
|
val <T> Expect<T>.its: Expect<T>
Inline property referring actually to |
|
val <T> AssertionContainer<T>.subjectChanger: SubjectChanger |
fun <T> Expect<T>._logicAppend(factory: AssertionContainer<T>.() -> Assertion): Expect<T>
Appends the Assertion the given factory creates based on this Expect. |
|
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 either every element holds all assertions created by the assertionCreatorOrNull or
that all elements are |
|
infix 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 either 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. |
|
infix fun <T> Expect<T>.and(o: o): Expect<T>
Can be used to separate single assertions. 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 |
|
infix 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 |
|
infix fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(o: o): Expect<Set<Entry<K, V>>>
Turns infix 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. |
|
infix fun <E, T : Sequence<E>> Expect<T>.asIterable(o: o): Expect<Iterable<E>>
Turns infix 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<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<E>> fun <E, T : Iterable<E>> Expect<T>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<T>
Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as List. |
|
infix fun <E> Expect<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<E>> infix fun <E, T : Iterable<E>> Expect<T>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<T>
Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as List. |
|
infix fun <T : File> Expect<T>.asPath(o: o): Expect<Path>
Turns |
|
fun <T, R> Expect<T>. |
|
fun <T, R> Expect<T>. |
|
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. |
|
infix 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> AssertionContainer<T>.collect(assertionCreator: Expect<T>.() -> Unit): Assertion
Use this function if you want to make Assertions about a feature or you perform a type transformation or any other action which results in an assertion container being created and you do not require this resulting container. |
|
fun <T : CharSequence> Expect<T>.contains(expected: CharSequenceOrNumberOrChar, vararg otherExpected: CharSequenceOrNumberOrChar): 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 |
|
infix fun <T : CharSequence> Expect<T>.contains(expected: CharSequenceOrNumberOrChar): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains the expected's toString representation. infix fun <T : CharSequence> Expect<T>.contains(values: Values<CharSequenceOrNumberOrChar>): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains the toString representation of the given values using a non disjoint search. infix fun <T : CharSequence> Expect<T>.contains(pattern: Regex): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression pattern. infix fun <T : CharSequence> Expect<T>.contains(regexPatterns: RegexPatterns): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression regexPatterns, using a non disjoint search. infix fun <T : CharSequence> Expect<T>.contains(patterns: All<Regex>): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression patterns, using a non disjoint search. infix fun <E, T : Iterable<E>> Expect<T>.contains(expected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) contains the expected value. infix fun <E, T : Iterable<E>> Expect<T>.contains(values: Values<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains the expected values. infix 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 infix fun <E : Any, T : Iterable<E?>> Expect<T>.contains(entries: Entries<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains an entry holding the
assertions created by entries.assertionCreatorOrNull or an entry
which is infix fun <E, T : Iterable<E>> Expect<T>.contains(noDuplicates: noDuplicates): Expect<T>
Expects that the subject of the assertion (an Iterable) does not have duplicate elements. infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePair: 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 infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePairs: Pairs<K, V>): Expect<T>
Expects the subject of the assertion (a Map) contains for each entry in keyValuePairs, a key as defined by that entry's Pair.first with a corresponding value as defined by entry's Pair.second. infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.contains(keyValue: KeyWithValueCreator<K, V>): Expect<T>
Expects that the subject of the assertion (a Map) contains a key as defined by keyValue's KeyWithValueCreator.key
with a corresponding value which either holds all assertions keyValue's
KeyWithValueCreator.valueAssertionCreatorOrNull creates or needs to be infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.contains(keyValues: All<KeyWithValueCreator<K, V>>): Expect<T>
Expects that the subject of the assertion (a Map) contains for each KeyWithValueCreator in keyValues,
a key as defined by KeyWithValueCreator.key with a corresponding value which either holds all
assertions KeyWithValueCreator's KeyWithValueCreator.valueAssertionCreatorOrNull creates or needs to be |
|
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 |
|
infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only the expected value. infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(values: Values<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only the expected values in the defined order. infix 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 infix fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(entries: Entries<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) contains only an entry holding
the assertions created by entries.assertionCreatorOrNull or
|
|
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. |
|
infix 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 <E, T : Iterable<E>> Expect<T>.containsNoDuplicates(): Expect<T>
Expects that the subject of the assertion (an Iterable) does not have duplicate elements. |
|
fun <T : CharSequence> Expect<T>.containsNot(expected: CharSequenceOrNumberOrChar, vararg otherExpected: CharSequenceOrNumberOrChar): 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) has at least one element and that it does not contain the expected value and neither one of the otherExpected values (if given). |
|
infix fun <T : CharSequence> Expect<T>.containsNot(expected: CharSequenceOrNumberOrChar): Expect<T>
Expects that the subject of the assertion (a CharSequence) does not contain expected's toString representation. infix fun <T : CharSequence> Expect<T>.containsNot(values: Values<CharSequenceOrNumberOrChar>): Expect<T>
Expects that the subject of the assertion (a CharSequence) does not contain the toString representation of the given values. infix fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element and that it does not contain the expected value. infix fun <E, T : Iterable<E>> Expect<T>.containsNot(values: Values<E>): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element and that it does not contain the expected values. |
|
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. |
|
infix 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. |
|
infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression pattern. |
|
fun <T> AssertionContainer<T>.createDescriptiveAssertion(description: Translatable, representation: Any?, test: (T) -> Boolean): Assertion
Creates a DescriptiveAssertion based on the given description, representation and test. |
|
fun <T, R> Expect<T>. |
|
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. |
|
infix 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. infix fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R>
Extracts the value which is returned when calling the method 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. infix fun <T, R> Expect<T>.feature(of: Feature<in T, R>): FeatureExpect<T, R>
Extracts a feature out of the current subject of the assertion using the given Feature.extractor, creates a new Expect for it and returns it so that subsequent calls are based on the feature. infix fun <T, R> Expect<T>.feature(of: FeatureWithCreator<in T, R>): Expect<T>
Extracts a feature out of the current subject of the assertion using the given FeatureWithCreator.extractor, creates a new Expect for it, applies an assertion group based on the given FeatureWithCreator.assertionCreator for the feature and returns the initial Expect with the current subject. infix 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. infix fun <T, R> Expect<T>.feature(of: MetaFeatureOptionWithCreator<T, R>): Expect<T>
Extracts a feature out of the current subject of the assertion, based on the given MetaFeatureOptionWithCreator creates a new Expect for it, applies an assertion group based on the given MetaFeatureOptionWithCreator.assertionCreator for the feature and returns the initial Expect with the current subject. |
|
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. |
|
infix 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 <T, R> AssertionContainer<T>.genericSubjectBasedFeature(provider: (T) -> MetaFeature<R>): FeatureExtractorBuilder.ExecutionStep<T, R> |
|
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. |
|
infix fun <E, T : List<E>> Expect<T>.get(index: IndexWithCreator<E>): 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 IndexWithCreator.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. |
|
infix 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. infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: KeyWithCreator<K, V>): 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 KeyWithCreator.assertionCreator creates for it. |
|
infix fun <T : Path> Expect<T>.has(directoryEntries: DirectoryEntries): Expect<T>
Expects that the subject of the assertion (a Path) is a directory having the provided entries. That means that there is a file system entry at the location the Path points to and that it is a directory. Furthermore, every argument string resolved against the subject yields an existing file system entry. |
|
fun <T : Path> Expect<T>.hasDirectoryEntry(entry: String, vararg otherEntries: String): Expect<T>
Expects that the subject of the assertion (a Path) is a directory having the provided entries. That means that there is a file system entry at the location the Path points to and that it is a directory. Furthermore, every argument string resolved against the subject yields an existing file system entry. |
|
infix fun <T : Path> Expect<T>.hasDirectoryEntry(entry: String): Expect<T>
Expects that the subject of the assertion (a Path) is a directory having the provided entry. That means that there is a file system entry at the location the Path points to and that it is a directory. Furthermore, the argument string resolved against the subject yields an existing file system entry. |
|
infix fun <T : Path> Expect<T>.hasSameTextualContentAs(targetPath: Path): Expect<T>
Expects that the subject of the assertion (a Path) has the same textual content as targetPath (using UTF-8 for encoding) infix fun <T : Path> Expect<T>.hasSameTextualContentAs(pathWithEncoding: PathWithEncoding): Expect<T>
Expects that the subject of the assertion (a Path) has the same textual content as PathWithEncoding.path in the given pathWithEncoding with the specified encodings. |
|
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. |
|
infix 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 : Path> Expect<T>.isAbsolute(): Expect<T>
Expects that the subject of the assertion (a Path) is an absolute path; meaning that the Path specified in this instance starts at the file system root. |
|
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. |
|
infix 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 <T : Path> Expect<T>.isExecutable(): Expect<T>
Expects that the subject of the assertion (a Path) is executable; meaning that there is a file system entry at the location the Path points to and that the current thread has the permission to execute it. |
|
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. |
|
infix 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 <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. |
|
infix fun <K, V, T : Entry<K, V>> Expect<T>.isKeyValue(keyValuePair: Pair<K, 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> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T>
Expects that the subject of the assertion is not (equal to) expected and otherValues. |
|
infix fun <T> Expect<T>.isNoneOf(values: Values<T>): Expect<T>
Expects that the subject of the assertion is not (equal to) in values. |
|
fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T>
Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotBlank. |
|
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. |
|
infix 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. |
|
infix 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. |
|
infix 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. |
|
infix 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(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 <E, T : Optional<E>> 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>.isRelative(): Expect<T>
Expects that the subject of the assertion (a Path) is a relative path; meaning that the Path specified in this instance does not start at the file system root. |
|
fun <T> Expect<T>.isSameAs(expected: T): Expect<T>
Expects that the subject of the assertion is the same instance as expected. |
|
infix 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. |
|
infix fun <T> Expect<T>.it(assertionCreator: Expect<T>.() -> Unit): Expect<T>
Can be used to create a group of sub assertions when using the fluent API. |
|
fun <T> AssertionContainer<*>.iterableLikeToIterable(iterableLike: IterableLike): Iterable<T>
Transforms the given IterableLike to an Iterable with an element type T. |
|
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. |
|
infix 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. |
|
infix 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, R> AssertionContainer<T>.manualFeature(description: String, provider: T.() -> R): FeatureExtractorBuilder.ExecutionStep<T, R>
Convenience method to pass a String as description which is wrapped into an Untranslatable instead of passing a Translatable. |
|
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 |
|
infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(o: o): Expect<E>
Creates an Expect for the result of calling infix 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>.messageContains(expected: CharSequenceOrNumberOrChar, vararg otherExpected: CharSequenceOrNumberOrChar): 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. |
|
infix fun <T : Throwable> Expect<T>.messageContains(expected: CharSequenceOrNumberOrChar): Expect<T>
Expects that the property Throwable.message of the subject of the assertion is not null and contains expected's toString representation using a non disjoint search. infix fun <T : Throwable> Expect<T>.messageContains(values: Values<Any>): Expect<T>
Expects that the property Throwable.message of the subject of the assertion is not null and contains values's toString representation 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 |
|
infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(o: o): Expect<E>
Creates an Expect for the result of calling infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Expects that the result of calling |
|
fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element and
that it either does not contain a single entry which holds all assertions created by assertionCreatorOrNull or
that it does not contain a single entry which is |
|
infix fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>
Expects that the subject of the assertion (an Iterable) has at least one element and
that it either does not contain a single entry which holds all assertions created by assertionCreatorOrNull or
that it 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. |
|
infix fun <T> Expect<T>.notToBe(expected: T): Expect<T>
Expects that the subject of the assertion is not (equal to) expected. infix fun <T : CharSequence> Expect<T>.notToBe(blank: blank): Expect<T>
Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotBlank. infix fun <T : Path> Expect<T>.notToBe(existing: existing): 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 <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. |
|
infix 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. |
|
infix fun <T : Path> Expect<T>.resolve(path: PathWithCreator<Path>): Expect<T>
Expects that PathWithCreator.path resolves against this Path, that the resolved Path holds all assertions the given PathWithCreator.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. |
|
infix 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 <T> Expect<T>.toAssertionContainer(): AssertionContainer<T>
Casts this Expect to an AssertionContainer so that you have access to the functionality provided on the logic level. |
|
fun <T> Expect<T>.toBe(expected: T): Expect<T>
Expects that the subject of the assertion is (equal to) expected. |
|
infix fun <T> Expect<T>.toBe(expected: T): Expect<T>
Expects that the subject of the assertion is (equal to) expected. infix fun <E, T : Optional<E>> Expect<T>.toBe(present: present): FeatureExpect<T, E>
Expects that the subject of the assertion (an Optional) is present and returns an Expect for the inner type E. infix fun <E, T : Optional<E>> Expect<T>.toBe(present: PresentWithCreator<E>): Expect<T>
Expects that the subject of the assertion (an Optional) is present and that it holds all assertions the given PresentWithCreator.assertionCreator creates. infix fun <T : Path> Expect<T>.toBe(existing: existing): 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. infix fun <T : Path> Expect<T>.toBe(readable: readable): 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. infix fun <T : Path> Expect<T>.toBe(writable: writable): 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. infix fun <T : Path> Expect<T>.toBe(executable: executable): Expect<T>
Expects that the subject of the assertion (a Path) is executable; meaning that there is a file system entry at the location the Path points to and that the current thread has the permission to execute it. infix fun <T : Path> Expect<T>.toBe(aRegularFile: aRegularFile): 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. infix fun <T : Path> Expect<T>.toBe(aDirectory: aDirectory): 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. infix fun <T : Path> Expect<T>.toBe(absolute: absolute): Expect<T>
Expects that the subject of the assertion (a Path) is an absolute path; meaning that the Path specified in this instance starts at the file system root. infix fun <T : Path> Expect<T>.toBe(relative: relative): Expect<T>
Expects that the subject of the assertion (a Path) is a relative path; meaning that the Path specified in this instance does not start at the file system root. |
|
infix fun <E, T : Result<E>> Expect<T>.toBe(success: success): Expect<E>
Expects that the subject of the assertion (a Result) is a Success and returns an Expect for the inner type E. infix fun <E, T : Result<E>> Expect<T>.toBe(success: SuccessWithCreator<E>): Expect<T>
Expects that the subject of the assertion (a Result]) is a Success and that it holds all assertions the given SuccessWithCreator.assertionCreator creates. |
|
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 <T> AssertionContainer<T>.toExpect(): Expect<T>
Casts this AssertionContainer back to an Expect so that you can use it in places where an Expect is used. |
|
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. |
|
infix 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 <T> AssertionContainer<*>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>
Transforms the given IterableLike to |
|
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. |
|
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. |
|
fun <K, V, T : Map<out 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. |
|
infix fun <K, V, T : Map<out 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. |