interface IAssertionPlant<out T : Any> : IAssertionPlantWithCommonFields<T>
Represents a plant for IAssertions and offers the possibility to check all the added assertions.
You can think of it as an IAssertion factory which does more than just factoring but also provides quality assurance capabilities.
open val and: IAssertionPlant<T>
Can be used to separate assertions when using the fluent-style API. |
abstract val commonFields: CommonFields<T>
CommonFields of this plant. |
|
open val subject: T
The subject for which this plant will create/check IAssertions. |
abstract fun addAssertion(assertion: IAssertion): IAssertionPlant<T>
Adds the given assertion to the plant. |
|
abstract fun checkAssertions(): IAssertionPlant<T>
Checks the so far added IAssertions and reports if one of them fails. |
|
abstract fun createAndAddAssertion(description: ITranslatable, expected: Any, test: () -> Boolean): IAssertionPlant<T>
Creates an IAssertion based on description, expected and test and adds it to the plant. |
val <T : Throwable> IAssertionPlant<T>.message: IAssertionPlant<String>
Creates an IAssertionPlantNullable for the message of the plant's subject (which is an Throwable) and makes the assertion that message isNotNull. |
fun <T : CharSequence> IAssertionPlant<T>.contains(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject contains the expected. fun <T : CharSequence> IAssertionPlant<T>.contains(expected: CharSequence, vararg otherExpected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject contains the expected and otherExpecteds (if defined). fun <T : CharSequence> IAssertionPlant<T>.contains(expected: ITranslatable, vararg otherExpected: ITranslatable): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject contains expected's getDefault representation and the getDefault representation of the otherExpected (if defined). fun <T : CharSequence> IAssertionPlant<T>.contains(expected: Any, vararg otherExpected: Any): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject contains expected's toString representation and the toString representation of the otherExpected (if defined). |
|
fun <T : CharSequence> IAssertionPlant<T>.containsNot(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject does not contain the expected. fun <T : CharSequence> IAssertionPlant<T>.containsNot(expected: CharSequence, vararg otherExpected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject does not contain the expected and neither one of the otherExpecteds (if defined). fun <T : CharSequence> IAssertionPlant<T>.containsNot(expected: ITranslatable, vararg otherExpected: ITranslatable): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject contains expected's getDefault representation and the getDefault representation of the otherExpected (if defined). fun <T : CharSequence> IAssertionPlant<T>.containsNot(expected: Any, vararg otherExpected: Any): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject does not contain expected's toString representation and neither one of the otherExpected's toString representation (if defined). |
|
fun <T : Any> IAssertionPlant<T>.createAssertionsAndCheckThem(createAssertions: IAssertionPlant<T>.() -> Unit): IAssertionPlant<T>
Uses |
|
fun <T : CharSequence> IAssertionPlant<T>.endsNotWith(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject does not end with expected. |
|
fun <T : CharSequence> IAssertionPlant<T>.endsWith(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject ends with expected. |
|
fun <T : Collection<*>> IAssertionPlant<T>.hasSize(size: Int): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject's Collection.size is size. |
|
fun <TSub : Any> IAssertionPlant<Any>.isA(): IAssertionPlant<TSub>
Makes the assertion that IAssertionPlant.subject is a TSub (the same type or a sub-type). fun <TSub : Any> IAssertionPlant<Any>.isA(createAssertions: IAssertionPlant<TSub>.() -> Unit): IAssertionPlant<TSub>
Makes the assertion that IAssertionPlant.subject is a TSub (the same type or a sub-type) and if so, uses createAssertions which could create further assertions which are lazily evaluated at the end. |
|
fun <T : CharSequence> IAssertionPlant<T>.isEmpty(): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject.kotlin.text.isEmpty. |
|
fun IAssertionPlant<Boolean>.isFalse(): IAssertionPlant<Boolean>
Makes the assertion that IAssertionPlant.subject is |
|
fun <T> IAssertionPlant<T>.isGreaterOrEquals(expected: T): IAssertionPlant<T> where T : Number, T : Comparable<T>
Makes the assertion that IAssertionPlant.subject is greater than or equals expected. |
|
fun <T> IAssertionPlant<T>.isGreaterThan(expected: T): IAssertionPlant<T> where T : Number, T : Comparable<T>
Makes the assertion that IAssertionPlant.subject is greater than expected. |
|
fun <T> IAssertionPlant<T>.isLessOrEquals(expected: T): IAssertionPlant<T> where T : Number, T : Comparable<T>
Makes the assertion that IAssertionPlant.subject is less than or equals expected. |
|
fun <T> IAssertionPlant<T>.isLessThan(expected: T): IAssertionPlant<T> where T : Number, T : Comparable<T>
Makes the assertion that IAssertionPlant.subject is less than expected. |
|
fun <T : CharSequence> IAssertionPlant<T>.isNotEmpty(): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject.kotlin.text.isNotEmpty. |
|
fun <T : Any> IAssertionPlant<T>.isNotSame(expected: T): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject is not the same instance as expected. |
|
fun <T : Any> IAssertionPlant<T>.isSame(expected: T): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject is the same instance as expected. |
|
fun IAssertionPlant<Boolean>.isTrue(): IAssertionPlant<Boolean>
Makes the assertion that IAssertionPlant.subject is |
|
fun <T : Any, TFeature : Any> IAssertionPlant<T>.its(feature: KProperty0<TFeature>): IAssertionPlant<TFeature>
Creates an IAssertionPlant which immediately evaluates IAssertions using the given feature as subject. fun <T : Any, TFeature : Any> IAssertionPlant<T>.its(feature: KProperty0<TFeature>, createAssertions: IAssertionPlant<TFeature>.() -> Unit): IAssertionPlant<TFeature>
Creates an IAssertionPlant which lazily evaluates IAssertions using the given feature as subject. |
|
fun <T : Throwable> IAssertionPlant<T>.message(createAssertions: IAssertionPlant<String>.() -> Unit): IAssertionPlant<String>
Creates an IAssertionPlantNullable for the message of the plant's subject (which is an Throwable) and makes the assertion that message isNotNull and uses createAssertions which might create further IAssertions which are lazily evaluated at the end. |
|
fun <T : Any> IAssertionPlant<T>.notToBe(expected: T): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject is not (does not equal) expected. |
|
fun <T : Any, TProperty : Any> IAssertionPlant<T>.property(property: KProperty0<TProperty>): IAssertionPlant<TProperty>
Creates an IAssertionPlant which immediately evaluates IAssertions using the given property as subject. fun <T : Any, TProperty : Any> IAssertionPlant<T>.property(property: KProperty0<TProperty>, createAssertions: IAssertionPlant<TProperty>.() -> Unit): IAssertionPlant<TProperty>
Creates an IAssertionPlant which lazily evaluates IAssertions using the given property as subject. |
|
fun <T : Any, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction0<TReturnValue>): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject. fun <T : Any, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction0<TReturnValue>, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject. fun <T : Any, T1, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction1<T1, TReturnValue>, arg1: T1): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject with arg1. fun <T : Any, T1, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction1<T1, TReturnValue>, arg1: T1, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject with arg1. fun <T : Any, T1, T2, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction2<T1, T2, TReturnValue>, arg1: T1, arg2: T2): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject with arg1 and arg2. fun <T : Any, T1, T2, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction2<T1, T2, TReturnValue>, arg1: T1, arg2: T2, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject with arg1 and arg2. fun <T : Any, T1, T2, T3, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction3<T1, T2, T3, TReturnValue>, arg1: T1, arg2: T2, arg3: T3): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2 and arg3. fun <T : Any, T1, T2, T3, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction3<T1, T2, T3, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2 and arg3. fun <T : Any, T1, T2, T3, T4, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction4<T1, T2, T3, T4, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2, arg3 and arg4. fun <T : Any, T1, T2, T3, T4, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction4<T1, T2, T3, T4, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2, arg3 and arg4. fun <T : Any, T1, T2, T3, T4, T5, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction5<T1, T2, T3, T4, T5, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which immediately evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2, arg3, arg4 and arg5. fun <T : Any, T1, T2, T3, T4, T5, TReturnValue : Any> IAssertionPlant<T>.returnValueOf(method: KFunction5<T1, T2, T3, T4, T5, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, createAssertions: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
Creates an IAssertionPlant which lazily evaluates IAssertions using the value returned by calling method of the subject with arg1, arg2, arg3, arg4 and arg5. |
|
fun <T : CharSequence> IAssertionPlant<T>.startsNotWith(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject does not start with expected. |
|
fun <T : CharSequence> IAssertionPlant<T>.startsWith(expected: CharSequence): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject starts with expected. |
|
fun <T : Any> IAssertionPlant<T>.toBe(expected: T): IAssertionPlant<T>
Makes the assertion that IAssertionPlant.subject is (equals) expected. |