doc / ch.tutteli.atrium.creating / IAssertionPlantNullable

IAssertionPlantNullable

interface IAssertionPlantNullable<out T> : IAssertionPlantWithCommonFields<T>

Represents an assertion plant for nullable types.

In contrast to a IAssertionPlant it does not provide a method to create further IAssertions (IAssertionPlant.createAndAddAssertion) nor a method to add assertions (IAssertionPlant.addAssertion) and as consequence no method to check the assertions (IAssertionPlant.checkAssertions). Yet, it provides one method isNull which immediately evaluates if the subject is null as expected.

Types

AssertionDescription

object AssertionDescription : ISimpleTranslatable

Use this description in an implementation to create an IOneMessageAssertion.

Inherited Properties

commonFields

abstract val commonFields: CommonFields<T>

CommonFields of this plant.

subject

open val subject: T

The subject for which this plant will create/check IAssertions.

Functions

isNull

abstract fun isNull(): Unit

Makes the assertion that subject is null and checks the assertion.

Extension Functions

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.