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

get

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

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.

infix fun <E, T : List<E>> Expect<T>.get(index: IndexWithCreator<E>): Expect<T>

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 IndexWithCreator.assertionCreator creates for it.

Use the function index(Int) { ... } to create an IndexWithCreator.

Exceptions

AssertionError - Might throw an AssertionError if the given index is out of bound or if the assertion made is not correct.

Return
This assertion container to support a fluent API.