doc / ch.tutteli.atrium

Package ch.tutteli.atrium

Contains the IAtriumFactory, all the assertion functions as well as the ITranslatables used in the assertion functions (e.g. DescriptionAnyAssertion)

Types

AtriumFactory

object AtriumFactory : IAtriumFactory

A dummy implementation of IAtriumFactory which should be replaced by an actual implementation.

DescriptionAnyAssertion

enum class DescriptionAnyAssertion : ISimpleTranslatable

Contains the Message.descriptions of the assertion functions which are applicable to Any.

DescriptionCharSequenceAssertion

enum class DescriptionCharSequenceAssertion : ISimpleTranslatable

Contains the Message.descriptions of the assertion functions which are applicable to CharSequence.

DescriptionCollectionAssertion

enum class DescriptionCollectionAssertion : ISimpleTranslatable

Contains the Message.descriptions of the assertion functions which are applicable to Collection.

DescriptionNarrowingAssertion

enum class DescriptionNarrowingAssertion : ISimpleTranslatable

Contains the Message.descriptions of the assertion functions which postulate that a IAssertionPlant.subject of type T can be narrowed to TSub where TSub <: T.

DescriptionNumberAssertion

enum class DescriptionNumberAssertion : ISimpleTranslatable

Contains the Message.descriptions of the assertion functions which are applicable to Number.

IAtriumFactory

interface IAtriumFactory

The minimum contract of the 'abstract factory' of atrium.

Properties

message

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.

Functions

contains

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).

containsNot

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).

endsNotWith

fun <T : CharSequence> IAssertionPlant<T>.endsNotWith(expected: CharSequence): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject does not end with expected.

endsWith

fun <T : CharSequence> IAssertionPlant<T>.endsWith(expected: CharSequence): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject ends with expected.

hasSize

fun <T : Collection<*>> IAssertionPlant<T>.hasSize(size: Int): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject's Collection.size is size.

isA

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.

isEmpty

fun <T : CharSequence> IAssertionPlant<T>.isEmpty(): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject.kotlin.text.isEmpty.

isFalse

fun IAssertionPlant<Boolean>.isFalse(): IAssertionPlant<Boolean>

Makes the assertion that IAssertionPlant.subject is false.

isGreaterOrEquals

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.

isGreaterThan

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.

isLessOrEquals

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.

isLessThan

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.

isNotEmpty

fun <T : CharSequence> IAssertionPlant<T>.isNotEmpty(): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject.kotlin.text.isNotEmpty.

isNotNull

fun <T : Any> IAssertionPlantNullable<T?>.isNotNull(): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is not null.

fun <T : Any> IAssertionPlantNullable<T?>.isNotNull(createAssertions: IAssertionPlant<T>.() -> Unit): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is not null and if so, uses createAssertions which could create further assertions which are lazily evaluated at the end.

isNotSame

fun <T : Any> IAssertionPlant<T>.isNotSame(expected: T): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is not the same instance as expected.

isSame

fun <T : Any> IAssertionPlant<T>.isSame(expected: T): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is the same instance as expected.

isTrue

fun IAssertionPlant<Boolean>.isTrue(): IAssertionPlant<Boolean>

Makes the assertion that IAssertionPlant.subject is true.

its

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.

message

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.

newCheckLazilyAtTheEnd

fun <T : Any> IAtriumFactory.newCheckLazilyAtTheEnd(assertionVerb: ITranslatable, subject: T, reporter: IReporter, createAssertions: IAssertionPlant<T>.() -> Unit): IAssertionPlant<T>

Use this function to create a custom assertion verb which lazy evaluates assertions (see IAtriumFactory.newCheckLazily).

newDownCastBuilder

fun <TSub : T, T : Any> IAtriumFactory.newDownCastBuilder(description: ITranslatable, commonFields: CommonFields<T?>): IDownCastBuilder<T, TSub>

Prepares a down cast; use IDownCastBuilder.cast to perform the down cast.

notToBe

fun <T : Any> IAssertionPlant<T>.notToBe(expected: T): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is not (does not equal) expected.

property

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.

returnValueOf

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.

startsNotWith

fun <T : CharSequence> IAssertionPlant<T>.startsNotWith(expected: CharSequence): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject does not start with expected.

startsWith

fun <T : CharSequence> IAssertionPlant<T>.startsWith(expected: CharSequence): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject starts with expected.

toBe

fun <T : Any> IAssertionPlant<T>.toBe(expected: T): IAssertionPlant<T>

Makes the assertion that IAssertionPlant.subject is (equals) expected.