doc / ch.tutteli.atrium.creating / BaseCollectingAssertionPlant

BaseCollectingAssertionPlant

interface BaseCollectingAssertionPlant<out T, out A : BaseAssertionPlant<T, A>, out C : BaseCollectingAssertionPlant<T, A, C>> : BaseAssertionPlant<T, A> (source)
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0

Represents a BaseAssertionPlant which is intended to serve as receiver object for lambdas which create Assertions, in which this assertion plant collects the so created assertions.

In contrast to BaseReportingAssertionPlant, this plant does not offer reporting capabilities. It merely offers a method to getAssertions (the collected ones).

Parameters

T - The type of the subject of this plant.

A - A subtype of BaseAssertionPlant -- has to correspond to A in C

C - A subtype of BaseCollectingAssertionPlant which is used in the fluent style API and as self type.

Properties

subject

abstract val subject: T

The subject for which this plant will create Assertions or it throws a PlantHasNoSubjectException if absent.

Inherited Properties

maybeSubject

open val maybeSubject: Option<T>

Either Some wrapping the subject of an Assertion or None in case a previous subject change could not be carried out.

subjectProvider

abstract val subjectProvider: () -> T

The provider which provides subject.

Functions

getAssertions

abstract fun getAssertions(): List<Assertion>

Returns the Assertions which have been added to this plant.

Inherited Functions

addAssertion

abstract fun addAssertion(assertion: Assertion): A

Adds the given assertion to this plant.

Extension Functions

asExpect

fun <T, A : BaseAssertionPlant<T, *>> A.asExpect(): Expect<T>

Turns Assert or AssertionPlantNullable into an Expect so that you can use new functionality which is not available on Assert/AssertionPlantNullable.

Inheritors

CollectingAssertionPlant

interface CollectingAssertionPlant<out T : Any> : AssertionPlant<T>, BaseCollectingAssertionPlant<T, AssertionPlant<T>, CollectingAssertionPlant<T>>

Represents an AssertionPlant which is intended to serve as receiver object for lambdas which create Assertions, in which this assertion plant collects the so created assertions.

CollectingAssertionPlantNullable

interface CollectingAssertionPlantNullable<out T> : AssertionPlantNullable<T>, BaseCollectingAssertionPlant<T, AssertionPlantNullable<T>, CollectingAssertionPlantNullable<T>>

Represents an AssertionPlantNullable which is intended to serve as receiver object for lambdas which create Assertions, in which this assertion plant collects the so created assertions.