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

createAndAddAssertion

open fun createAndAddAssertion(description: ITranslatable, expected: Any, test: () -> Boolean): IAssertionPlant<T>

Creates an IBasicAssertion based on the given description, expected and test and adds it to the plant.

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 IAssertions are immediately evaluated (see IReportingAssertionPlant).

Return
This plant to support a fluent API.