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

get

fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E> (source)

Expects that the given index is within the bounds of the subject of the assertion (a List) and returns an Expect for the element at that position.

Exceptions

AssertionError - Might throw an AssertionError if the given index is out of bound.

Return
The newly created Expect for the element at position index.

fun <E, T : List<E>> Expect<T>.get(index: Int, assertionCreator: Expect<E>.() -> Unit): Expect<T> (source)

Expects that the given index is within the bounds of the subject of the assertion (a List) and that the element at that position holds all assertions the given assertionCreator creates for it.

Exceptions

AssertionError - Might throw an AssertionError if the given index is out of bound.

Return
An Expect for the current subject of the assertion.