doc / ch.tutteli.atrium.creating / BaseAssertionPlant

BaseAssertionPlant

interface BaseAssertionPlant<out T, out A : BaseAssertionPlant<T, A>> : SubjectProvider<T>
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0

Represents a plant for Assertions and offers methods to addAssertions to this plant.

It defines what AssertionPlant and AssertionPlantNullable have in common. However it is typically not used as entry point for assertion functions. Most of the time you want to define an assertion function for AssertionPlant, Assert respectively (Assert is a typealias of AssertionPlant).

Parameters

T - The type of the subject of this BaseAssertionPlant.

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

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.

Inherited Properties

subject

abstract val subject: T

The subject of an Assertion -- deprecated, will be removed with 1.0.0.

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>
fun <T : Any, A : BaseAssertionPlant<T, *>> A.asExpect(assertionCreator: Expect<T>.() -> Unit): A

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

Inheritors

AssertionPlant

interface AssertionPlant<out T : Any> : BaseAssertionPlant<T, AssertionPlant<T>>

Represents a plant for Assertions based on a non nullable subject.

AssertionPlantNullable

interface AssertionPlantNullable<out T> : BaseAssertionPlant<T, AssertionPlantNullable<T>>

Represents an assertion plant for nullable types.

BaseCollectingAssertionPlant

interface BaseCollectingAssertionPlant<out T, out A : BaseAssertionPlant<T, A>, out C : BaseCollectingAssertionPlant<T, A, C>> : BaseAssertionPlant<T, A>

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.

BaseReportingAssertionPlant

interface BaseReportingAssertionPlant<out T, out A : BaseAssertionPlant<T, A>> : BaseAssertionPlant<T, A>, AssertionPlantWithCommonFields<T>

Represents a plant for Assertions and offers methods to addAssertions to this plant.