doc / ch.tutteli.atrium.assertions

Package ch.tutteli.atrium.assertions

Contains different types of IAssertion -- e.g. BasicAssertion -- as well as assertion function templates which can be used in API modules such as ch.tutteli.atrium.api.cc.en_UK.

Types

AssertionGroup

data class AssertionGroup : IAssertionGroup

Represents a group of IAssertions -- it has a certain type, a name, a subject and of course assertions.

BasicAssertion

class BasicAssertion : IBasicAssertion

A default implementation for IBasicAssertion which lazily evaluates holds.

DescriptionAnyAssertion

enum class DescriptionAnyAssertion : ISimpleTranslatable

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

DescriptionBasic

enum class DescriptionBasic : ISimpleTranslatable

Contains the IBasicAssertion.descriptions which are so basic that one does not want to use a different wording in a two different assertion functions.

DescriptionCharSequenceAssertion

enum class DescriptionCharSequenceAssertion : ISimpleTranslatable

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

DescriptionCollectionAssertion

enum class DescriptionCollectionAssertion : ISimpleTranslatable

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

DescriptionIterableAssertion

enum class DescriptionIterableAssertion : ISimpleTranslatable

Contains the IBasicAssertion.descriptions of the assertion functions which are applicable to Iterable.

DescriptionNarrowingAssertion

enum class DescriptionNarrowingAssertion : ISimpleTranslatable

Contains the IBasicAssertion.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 IBasicAssertion.descriptions of the assertion functions which are applicable to Number.

DescriptionThrowableAssertion

enum class DescriptionThrowableAssertion : ISimpleTranslatable

Contains the IBasicAssertion.descriptions of the assertion functions which are applicable to Throwable.

EmptyNameAndSubjectAssertionGroup

abstract class EmptyNameAndSubjectAssertionGroup : IAssertionGroup

Represents a base class for IAssertionGroups which have an empty name and subject.

ExplanatoryAssertion

class ExplanatoryAssertion : IExplanatoryAssertion

Represents an assertion which only wants to give an explanation

ExplanatoryAssertionGroup

class ExplanatoryAssertionGroup : EmptyNameAndSubjectAssertionGroup

Represents an IAssertionGroup with an ExplanatoryAssertionGroupType, which means an IReporter should not show whether the assertions hold or not -- moreover holds always returns true.

ExplanatoryAssertionGroupType

object ExplanatoryAssertionGroupType : IExplanatoryAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose assertions are used to explain something rather than pointing something out -- accordingly the IAssertionGroup.holds should always return true.

FeatureAssertionGroupType

object FeatureAssertionGroupType : IFeatureAssertionGroupType

The IAssertionGroupType for IAssertionGroups which contain any kind of feature assertions.

FixHoldsAssertionGroup

data class FixHoldsAssertionGroup : IAssertionGroup

Represents a group of IAssertions -- it has a certain type, a name, a subject, assertions and a fixed value for holds which does not depend on assertions (usually indirectly).

IAssertion

interface IAssertion

The base interface of all assertions, providing the method holds.

IAssertionGroup

interface IAssertionGroup : IAssertion

The base interface for IAssertion groups, providing a default implementation for IAssertion.holds which returns true if all its assertions hold.

IAssertionGroupType

interface IAssertionGroupType : IBulletPointIdentifier

Represents a type of an IAssertionGroup.

IBasicAssertion

interface IBasicAssertion : IAssertion

The base interface for IAssertions which only consists of the expected result with a complementary description.

IBulletPointIdentifier

interface IBulletPointIdentifier

A marker interface for types which can be used to identify bullet points in IAtriumFactory.registerSameLineTextAssertionFormatterCapabilities.

IDoNotFilterAssertionGroupType

interface IDoNotFilterAssertionGroupType : IAssertionGroupType

An IAssertionGroupType which indicates that a IReporter should not filter its IAssertionGroup.assertions.

IExplanatoryAssertion

interface IExplanatoryAssertion : IAssertion

Represents an IAssertion which is typically used in an IAssertionGroup with a IExplanatoryAssertionGroupType and provides an explanation which is typically formatted by an IObjectFormatter in reporting.

IExplanatoryAssertionGroupType

interface IExplanatoryAssertionGroupType : IDoNotFilterAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups whose assertions are mainly used to explain something -- it is not of importance whether they hold or not and thus such IAssertionGroups should always return true for holds.

IFeatureAssertionGroupType

interface IFeatureAssertionGroupType : IAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups which contain some kind of feature assertions.

IIndentAssertionGroupType

interface IIndentAssertionGroupType : IAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups whose assertions should be displayed with an extra indent. Such a group might have a IAssertionGroup.name and IAssertionGroup.subject (by accident) but should not be mentioned in reporting.

IInvisibleAssertionGroupType

interface IInvisibleAssertionGroupType : IAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups whose assertions should be displayed in a manner that the user does not even notice that the IAssertions have been grouped.

IListAssertionGroupType

interface IListAssertionGroupType : IAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups whose assertions should be displayed in a list (up to the IReporter if it is a list with bullets, squares etc.).

ISummaryAssertionGroupType

interface ISummaryAssertionGroupType : IDoNotFilterAssertionGroupType

Represents the IAssertionGroupType for IAssertionGroups whose assertions should all be reported in reporting (no filtering by an IReporter) since it represents a summary which itself will point out which assertions hold and which do not.

IndentAssertionGroup

class IndentAssertionGroup : EmptyNameAndSubjectAssertionGroup

Represents an IAssertionGroup with an IIndentAssertionGroupType, which means the assertions shall be indented one extra level and name and subject shall be neglected (not reported to the output).

IndentAssertionGroupType

object IndentAssertionGroupType : IIndentAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose assertions should be displayed with an extra indent.

InvisibleAssertionGroup

class InvisibleAssertionGroup : EmptyNameAndSubjectAssertionGroup

Represents an IAssertionGroup with an InvisibleAssertionGroupType, which means the grouping should be invisible in reporting.

InvisibleAssertionGroupType

object InvisibleAssertionGroupType : IInvisibleAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose grouping behaviour should be kind of invisible to the user.

LazyThreadUnsafeAssertionGroup

class LazyThreadUnsafeAssertionGroup : IAssertionGroup

Represents an IAssertionGroup which is evaluated lazily where the lazy loading is not thread safe.

LazyThreadUnsafeBasicAssertion

class LazyThreadUnsafeBasicAssertion : IBasicAssertion

Represents an IBasicAssertion which is evaluated lazily where the lazy loading is not thread safe.

ListAssertionGroupType

object ListAssertionGroupType : IListAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose assertions should be displayed in a list.

PrefixFailingSummaryAssertion

class PrefixFailingSummaryAssertion : IBulletPointIdentifier

Represents the identifier for bullet points used to prefix IAssertions which do not hold, in context of an IAssertionGroup with type ISummaryAssertionGroupType.

PrefixFeatureAssertionGroupHeader

class PrefixFeatureAssertionGroupHeader : IBulletPointIdentifier

This class is only used as identifier for IAtriumFactory.registerSameLineTextAssertionFormatterCapabilities.

PrefixSuccessfulSummaryAssertion

class PrefixSuccessfulSummaryAssertion : IBulletPointIdentifier

Represents the identifier for bullet points used to prefix IAssertions which hold, in context of an IAssertionGroup with type ISummaryAssertionGroupType.

RootAssertionGroupType

object RootAssertionGroupType : IAssertionGroupType

The IAssertionGroupType for IAssertionGroups which are the root of all assertions.

SummaryAssertionGroupType

object SummaryAssertionGroupType : ISummaryAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose assertions should not be filtered (by an IReporter) and for which an IAssertionFormatter should state whether they hold or not.

WarningAssertionGroupType

object WarningAssertionGroupType : IExplanatoryAssertionGroupType

The IAssertionGroupType for IAssertionGroups whose assertions are used to state a warning rather than making an assumption.

Functions

_containsBuilder

fun <T : CharSequence> _containsBuilder(plant: IAssertionPlant<T>): CharSequenceContainsBuilder<T, CharSequenceContainsNoOpSearchBehaviour>

_containsEntriesInAnyOrder

fun <E : Any, T : Iterable<E>> _containsEntriesInAnyOrder(checker: IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>, assertionCreator: IAssertionPlant<E>.() -> Unit, otherAssertionCreators: Array<IAssertionPlant<E>.() -> Unit>): IAssertion

_containsEntriesInAnyOrderOnly

fun <E : Any, T : Iterable<E>> _containsEntriesInAnyOrderOnly(builder: IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>, assertionCreator: IAssertionPlant<E>.() -> Unit, otherAssertionCreators: Array<IAssertionPlant<E>.() -> Unit>): IAssertion

_containsEntriesInOrderOnly

fun <E : Any, T : Iterable<E>> _containsEntriesInOrderOnly(builder: IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>, assertionCreator: IAssertionPlant<E>.() -> Unit, otherAssertionCreators: Array<IAssertionPlant<E>.() -> Unit>): IAssertion

_containsNot

fun <T : CharSequence> _containsNot(plant: IAssertionPlant<T>, expected: Any, vararg otherExpected: Any): IAssertion
fun <E, T : Iterable<E>> _containsNot(plant: IAssertionPlant<T>, expected: E, vararg otherExpected: E): IAssertion

_containsNotDefaultTranslationOf

fun <T : CharSequence> _containsNotDefaultTranslationOf(plant: IAssertionPlant<T>, expected: ITranslatable, vararg otherExpected: ITranslatable): IAssertion

_containsObjectsInAnyOrder

fun <E, T : Iterable<E>> _containsObjectsInAnyOrder(checker: IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>, expected: E, otherExpected: Array<out E>): IAssertion

_containsObjectsInAnyOrderOnly

fun <E, T : Iterable<E>> _containsObjectsInAnyOrderOnly(builder: IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>, expected: E, otherExpected: Array<out E>): IAssertion

_containsObjectsInOrderOnly

fun <E, T : Iterable<E>> _containsObjectsInOrderOnly(builder: IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>, expected: E, otherExpected: Array<out E>): IAssertion

_containsRegex

fun <T : CharSequence> _containsRegex(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>, expected: Any, otherExpected: Array<out Any>): IAssertionGroup

_containsRegexIgnoringCase

fun <T : CharSequence> _containsRegexIgnoringCase(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>, expected: Any, otherExpected: Array<out Any>): IAssertionGroup

_containsValues

fun <T : CharSequence> _containsValues(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>, expected: Any, otherExpected: Array<out Any>): IAssertionGroup

_containsValuesIgnoringCase

fun <T : CharSequence> _containsValuesIgnoringCase(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>, expected: Any, otherExpected: Array<out Any>): IAssertionGroup

_downCast

fun <T : Any, TSub : T> _downCast(description: ITranslatable, subType: KClass<TSub>, subjectPlant: IBaseAssertionPlant<T?, *>, assertionCreator: IAssertionPlant<TSub>.() -> Unit): Unit

_endsNotWith

fun <T : CharSequence> _endsNotWith(plant: IAssertionPlant<T>, expected: CharSequence): IAssertion

_endsWith

fun <T : CharSequence> _endsWith(plant: IAssertionPlant<T>, expected: CharSequence): IAssertion

_hasSize

fun <T : Collection<*>> _hasSize(plant: IAssertionPlant<T>, size: Int): IAssertion

_isA

fun <TSub : Any> _isA(plant: IAssertionPlant<Any>, assertionCreator: IAssertionPlant<TSub>.() -> Unit): Unit

_isEmpty

fun <T : CharSequence> _isEmpty(plant: IAssertionPlant<T>): IAssertion

_isGreaterOrEquals

fun <T> _isGreaterOrEquals(plant: IAssertionPlant<T>, expected: T): IAssertion where T : Number, T : Comparable<T>

_isGreaterThan

fun <T> _isGreaterThan(plant: IAssertionPlant<T>, expected: T): IAssertion where T : Number, T : Comparable<T>

_isLessOrEquals

fun <T> _isLessOrEquals(plant: IAssertionPlant<T>, expected: T): IAssertion where T : Number, T : Comparable<T>

_isLessThan

fun <T> _isLessThan(plant: IAssertionPlant<T>, expected: T): IAssertion where T : Number, T : Comparable<T>

_isNotEmpty

fun <T : CharSequence> _isNotEmpty(plant: IAssertionPlant<T>): IAssertion

_isNotNull

fun <T : Any> _isNotNull(plant: IAssertionPlantNullable<T?>, assertionCreator: IAssertionPlant<T>.() -> Unit): Unit

_isNotSame

fun <T : Any> _isNotSame(plant: IAssertionPlant<T>, expected: T): IAssertion

_isNull

fun <T> _isNull(plant: IAssertionPlantNullable<T>): IAssertion

_isSame

fun <T : Any> _isSame(plant: IAssertionPlant<T>, expected: T): IAssertion

_notToBe

fun <T : Any> _notToBe(plant: IAssertionPlant<T>, expected: T): IAssertion

_property

fun <T : Any, TProperty : Any> _property(plant: IAssertionPlant<T>, property: KProperty0<TProperty>): IAssertionPlant<TProperty>
fun <T : Any, TProperty : Any> _property(plant: IAssertionPlant<T>, property: KProperty0<TProperty>, assertionCreator: IAssertionPlant<TProperty>.() -> Unit): IAssertionPlant<TProperty>

_returnValueOf

fun <T : Any, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction0<TReturnValue>): IAssertionPlant<TReturnValue>
fun <T : Any, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction0<TReturnValue>, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
fun <T : Any, T1, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction1<T1, TReturnValue>, arg1: T1): IAssertionPlant<TReturnValue>
fun <T : Any, T1, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction1<T1, TReturnValue>, arg1: T1, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction2<T1, T2, TReturnValue>, arg1: T1, arg2: T2): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction2<T1, T2, TReturnValue>, arg1: T1, arg2: T2, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction3<T1, T2, T3, TReturnValue>, arg1: T1, arg2: T2, arg3: T3): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction3<T1, T2, T3, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, T4, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction4<T1, T2, T3, T4, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, T4, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction4<T1, T2, T3, T4, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, T4, T5, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction5<T1, T2, T3, T4, T5, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): IAssertionPlant<TReturnValue>
fun <T : Any, T1, T2, T3, T4, T5, TReturnValue : Any> _returnValueOf(plant: IAssertionPlant<T>, method: KFunction5<T1, T2, T3, T4, T5, TReturnValue>, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, assertionCreator: IAssertionPlant<TReturnValue>.() -> Unit): IAssertionPlant<TReturnValue>

_startsNotWith

fun <T : CharSequence> _startsNotWith(plant: IAssertionPlant<T>, expected: CharSequence): IAssertion

_startsWith

fun <T : CharSequence> _startsWith(plant: IAssertionPlant<T>, expected: CharSequence): IAssertion

_toBe

fun <T : Any> _toBe(plant: IAssertionPlant<T>, expected: T): IAssertion

_toThrow

fun <TExpected : Throwable> _toThrow(throwableThrownBuilder: ThrowableThrownBuilder, assertionCreator: IAssertionPlant<TExpected>.() -> Unit): Unit