doc / ch.tutteli.atrium.creating / Expect / createAndAddAssertion

createAndAddAssertion

open fun createAndAddAssertion(description: String, expected: Any?, test: (T) -> Boolean): Expect<T> (source)

Creates a DescriptiveAssertion based on the given description, expected and test and adds it to the container.

Parameters

description - The description of the assertion, e.g., is less than.

expected - The expected value, e.g., 5

test - Indicates whether the assertion holds or fails.

Exceptions

AssertionError - Might throw an AssertionError in case Assertions are immediately evaluated (see ReportingAssertionContainer).

Return
An Expect for the current subject of the assertion.

open fun createAndAddAssertion(description: Translatable, expected: Any?, test: (T) -> Boolean): Expect<T> (source)

Creates a DescriptiveAssertion based on the given description, expected and test and adds it to the container.

Parameters

description - The description of the assertion in form of a Translatable.

expected - The expected value, e.g., 5

test - Indicates whether the assertion holds or fails.

Exceptions

AssertionError - Might throw an AssertionError in case Assertions are immediately evaluated (see ReportingAssertionContainer).

Return
An Expect for the current subject of the assertion.