doc / ch.tutteli.atrium.creating.impl / BaseExpectImpl / appendAsGroup

appendAsGroup

open fun appendAsGroup(assertionCreator: Expect<T>.() -> Unit): Expect<T> (source)

Overrides AssertionContainer.appendAsGroup

Appends the Assertions the given assertionCreator creates to this container and returns an Expect which includes them.

Whether the returned Expect is the same as the initial one is up to the implementation (i.e. if a mutable structure is used or an immutable). Atrium strives for an immutable data structure in the long run and will little by little refactor the code accordingly.

Parameters

assertionCreator - The lambda which will create assertions.

Exceptions

AssertionError - Might throw an AssertionError in case Assertions are immediately evaluated.

Return
an Expect for the subject of this expectation.

protected fun appendAsGroup(assertions: List<Assertion>): Expect<T> (source)