strikt-core / strikt.api / Assertion / Builder / assertThat

assertThat

open fun assertThat(description: String, assert: (T) -> Boolean): Builder<T>

Evaluates a boolean condition. This is useful for implementing the simplest types of assertion function.

Parameters

description - a description for the condition the assertion evaluates.

assert - a function that returns true (the assertion passes) or false (the assertion fails).

Return
the chained assertion builder, in order to facilitate a fluent API.

open fun assertThat(description: String, expected: Any?, assert: (T) -> Boolean): Builder<T>

Evaluates a boolean condition. This is useful for implementing the simplest types of assertion function.

Parameters

description - a description for the condition the assertion evaluates.

expected - the expected value of a comparison.

assert - a function that returns true (the assertion passes) or false (the assertion fails).

Return
the chained assertion builder, in order to facilitate a fluent API.