doc / ch.tutteli.atrium.assertions

Package ch.tutteli.atrium.assertions

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

Types

Assertion

interface Assertion

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

AssertionGroup

interface AssertionGroup : Assertion

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

AssertionGroupType

interface AssertionGroupType : BulletPointIdentifier

Represents a type of an AssertionGroup.

BasicAssertionGroup

data class BasicAssertionGroup : AssertionGroup

A default implementation for AssertionGroup -- it has a certain type, a name, a subject and of course assertions.

BasicDescriptiveAssertion

class BasicDescriptiveAssertion : DescriptiveAssertion

A default implementation for DescriptiveAssertion which lazily evaluates holds.

BasicExplanatoryAssertion

class BasicExplanatoryAssertion : ExplanatoryAssertion

A default implementation for ExplanatoryAssertion -- an assertion which only wants to give an explanation.

BulletPointIdentifier

interface BulletPointIdentifier

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

DefaultExplanatoryAssertionGroupType

object DefaultExplanatoryAssertionGroupType : ExplanatoryAssertionGroupType

The AssertionGroupType for AssertionGroups whose assertions are used to explain something rather than pointing something out -- accordingly the AssertionGroup.holds should always return true.

DefaultFeatureAssertionGroupType

object DefaultFeatureAssertionGroupType : FeatureAssertionGroupType

The AssertionGroupType for AssertionGroups which contain any kind of feature assertions.

DefaultIndentAssertionGroupType

object DefaultIndentAssertionGroupType : IndentAssertionGroupType

The AssertionGroupType for AssertionGroups whose assertions should be displayed with an extra indent.

DefaultInvisibleAssertionGroupType

object DefaultInvisibleAssertionGroupType : InvisibleAssertionGroupType

The AssertionGroupType for AssertionGroups whose grouping behaviour should be kind of invisible to the user.

DefaultListAssertionGroupType

object DefaultListAssertionGroupType : ListAssertionGroupType

The AssertionGroupType for AssertionGroups whose assertions should be displayed in a list.

DefaultSummaryAssertionGroupType

object DefaultSummaryAssertionGroupType : SummaryAssertionGroupType

The AssertionGroupType for AssertionGroups whose assertions should not be filtered (by a Reporter) and for which an AssertionFormatter should state whether they hold or not.

DescriptionAnyAssertion

enum class DescriptionAnyAssertion : StringBasedTranslatable

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

DescriptionBasic

enum class DescriptionBasic : StringBasedTranslatable

Contains the DescriptiveAssertion.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 : StringBasedTranslatable

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

DescriptionCollectionAssertion

enum class DescriptionCollectionAssertion : StringBasedTranslatable

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

DescriptionIterableAssertion

enum class DescriptionIterableAssertion : StringBasedTranslatable

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

DescriptionNarrowingAssertion

enum class DescriptionNarrowingAssertion : StringBasedTranslatable

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

DescriptionNumberAssertion

enum class DescriptionNumberAssertion : StringBasedTranslatable

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

DescriptionThrowableAssertion

enum class DescriptionThrowableAssertion : StringBasedTranslatable

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

DescriptiveAssertion

interface DescriptiveAssertion : Assertion

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

DoNotFilterAssertionGroupType

interface DoNotFilterAssertionGroupType : AssertionGroupType

An AssertionGroupType which indicates that a Reporter should not filter its AssertionGroup.assertions.

EmptyNameAndSubjectAssertionGroup

abstract class EmptyNameAndSubjectAssertionGroup : AssertionGroup

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

ExplanatoryAssertion

interface ExplanatoryAssertion : Assertion

Represents an Assertion which is typically used in an AssertionGroup with a ExplanatoryAssertionGroupType and provides an explanation which is typically formatted by an ObjectFormatter in reporting.

ExplanatoryAssertionGroup

class ExplanatoryAssertionGroup : EmptyNameAndSubjectAssertionGroup

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

ExplanatoryAssertionGroupType

interface ExplanatoryAssertionGroupType : DoNotFilterAssertionGroupType

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

FeatureAssertionGroupType

interface FeatureAssertionGroupType : AssertionGroupType

Represents the AssertionGroupType for AssertionGroups which contain some kind of feature assertions.

FixHoldsAssertionGroup

data class FixHoldsAssertionGroup : AssertionGroup

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

IndentAssertionGroup

class IndentAssertionGroup : EmptyNameAndSubjectAssertionGroup

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

IndentAssertionGroupType

interface IndentAssertionGroupType : AssertionGroupType

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

InvisibleAssertionGroup

class InvisibleAssertionGroup : EmptyNameAndSubjectAssertionGroup

Represents an AssertionGroup with a DefaultInvisibleAssertionGroupType, which means the grouping should be invisible in reporting.

InvisibleAssertionGroupType

interface InvisibleAssertionGroupType : AssertionGroupType

Represents the AssertionGroupType for AssertionGroups whose assertions should be displayed in a manner that the user does not even notice that the Assertions have been grouped.

LazyThreadUnsafeAssertionGroup

class LazyThreadUnsafeAssertionGroup : AssertionGroup

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

LazyThreadUnsafeBasicAssertion

class LazyThreadUnsafeBasicAssertion : DescriptiveAssertion

Represents a DescriptiveAssertion which is evaluated lazily where the lazy loading is not thread safe.

ListAssertionGroupType

interface ListAssertionGroupType : AssertionGroupType

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

PrefixFailingSummaryAssertion

class PrefixFailingSummaryAssertion : BulletPointIdentifier

Represents the identifier for bullet points used to prefix Assertions which do not hold, in context of an AssertionGroup with type SummaryAssertionGroupType.

PrefixFeatureAssertionGroupHeader

class PrefixFeatureAssertionGroupHeader : BulletPointIdentifier

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

PrefixSuccessfulSummaryAssertion

class PrefixSuccessfulSummaryAssertion : BulletPointIdentifier

Represents the identifier for bullet points used to prefix Assertions which hold, in context of an AssertionGroup with type SummaryAssertionGroupType.

RootAssertionGroupType

object RootAssertionGroupType : AssertionGroupType

The AssertionGroupType for AssertionGroups which are the root of all assertions.

SummaryAssertionGroupType

interface SummaryAssertionGroupType : DoNotFilterAssertionGroupType

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

WarningAssertionGroupType

object WarningAssertionGroupType : ExplanatoryAssertionGroupType

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

Functions

_containsBuilder

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

_containsDefaultTranslationOf

fun <T : CharSequence> _containsDefaultTranslationOf(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsNoOpSearchBehaviour>, expected: Translatable, otherExpected: Array<out Translatable>): AssertionGroup

_containsDefaultTranslationOfIgnoringCase

fun <T : CharSequence> _containsDefaultTranslationOfIgnoringCase(checker: CharSequenceContainsCheckerBuilder<T, CharSequenceContainsIgnoringCaseSearchBehaviour>, expected: Translatable, otherExpected: Array<out Translatable>): AssertionGroup

_containsEntriesInAnyOrder

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

_containsEntriesInAnyOrderOnly

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

_containsEntriesInOrderOnly

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

_containsNot

fun <T : CharSequence> _containsNot(plant: AssertionPlant<T>, expected: Any, otherExpected: Array<out Any>): Assertion
fun <E, T : Iterable<E>> _containsNot(plant: AssertionPlant<T>, expected: E, otherExpected: Array<out E>): Assertion

_containsNotDefaultTranslationOf

fun <T : CharSequence> _containsNotDefaultTranslationOf(plant: AssertionPlant<T>, expected: Translatable, otherExpected: Array<out Translatable>): Assertion

_containsObjectsInAnyOrder

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

_containsObjectsInAnyOrderOnly

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

_containsObjectsInOrderOnly

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

_containsRegex

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

_containsRegexIgnoringCase

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

_containsValues

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

_containsValuesIgnoringCase

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

_downCast

fun <T : Any, TSub : T> _downCast(description: Translatable, subType: KClass<TSub>, subjectPlant: BaseAssertionPlant<T?, *>, assertionCreator: AssertionPlant<TSub>.() -> Unit): Unit

_endsNotWith

fun <T : CharSequence> _endsNotWith(plant: AssertionPlant<T>, expected: CharSequence): Assertion

_endsWith

fun <T : CharSequence> _endsWith(plant: AssertionPlant<T>, expected: CharSequence): Assertion

_hasSize

fun <T : Collection<*>> _hasSize(plant: AssertionPlant<T>, size: Int): Assertion

_isA

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

_isEmpty

fun <T : CharSequence> _isEmpty(plant: AssertionPlant<T>): Assertion

_isGreaterOrEquals

fun <T> _isGreaterOrEquals(plant: AssertionPlant<T>, expected: T): Assertion where T : Number, T : Comparable<T>

_isGreaterThan

fun <T> _isGreaterThan(plant: AssertionPlant<T>, expected: T): Assertion where T : Number, T : Comparable<T>

_isLessOrEquals

fun <T> _isLessOrEquals(plant: AssertionPlant<T>, expected: T): Assertion where T : Number, T : Comparable<T>

_isLessThan

fun <T> _isLessThan(plant: AssertionPlant<T>, expected: T): Assertion where T : Number, T : Comparable<T>

_isNotEmpty

fun <T : CharSequence> _isNotEmpty(plant: AssertionPlant<T>): Assertion

_isNotNull

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

_isNotSame

fun <T : Any> _isNotSame(plant: AssertionPlant<T>, expected: T): Assertion

_isNull

fun <T> _isNull(plant: AssertionPlantNullable<T>): Assertion

_isSame

fun <T : Any> _isSame(plant: AssertionPlant<T>, expected: T): Assertion

_notToBe

fun <T : Any> _notToBe(plant: AssertionPlant<T>, expected: T): Assertion

_property

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

_returnValueOf

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

_startsNotWith

fun <T : CharSequence> _startsNotWith(plant: AssertionPlant<T>, expected: CharSequence): Assertion

_startsWith

fun <T : CharSequence> _startsWith(plant: AssertionPlant<T>, expected: CharSequence): Assertion

_toBe

fun <T : Any> _toBe(plant: AssertionPlant<T>, expected: T): Assertion

_toThrow

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