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

and

inline val <T> Expect<T>.and: Expect<T> (source)

Can be used to separate single assertions.

For instance expect(1).isLessThan(2).and.isGreaterThan(0) creates two assertions (not one assertion with two sub-assertions) - the first asserts that 1 is less than 2 and the second asserts that 1 is greater than 0. If the first assertion fails, then usually (depending on the configured AssertionChecker) the second assertion is not evaluated.

Return
An Expect for the current subject of the assertion.

infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> (source)

Can be used to create a group of sub assertions when using the fluent API.

For instance assert(1).isLessThan(3).and { isEven(); isGreaterThan(1) } creates two assertions where the second one consists of two sub-assertions. In case the first assertion holds, then the second one is evaluated as a whole. Meaning, even though 1 is not even, it still evaluates that 1 is greater than 1. Hence the reporting might (depending on the configured Reporter) contain both failing sub-assertions.

Return
An Expect for the current subject of the assertion.