doc / ch.tutteli.atrium.api.fluent.en_GB / isPresent

isPresent

fun <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E> (source)

Expects that the subject of this expectation (an Optional) is present and returns an Expect for the inner type E.

Shortcut for more or less something like feature(Optional<T>::get) but with error handling; yet it depends on the underlying implementation though.

Return
The newly created Expect for the inner type E.

Since
0.9.0

fun <E, T : Optional<E>> Expect<T>.isPresent(assertionCreator: Expect<E>.() -> Unit): Expect<T> (source)

Expects that the subject of this expectation (an Optional) is present and that it holds all assertions the given assertionCreator creates.

Return
an Expect for the subject of this expectation.

Since
0.9.0