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

passesIf

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

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
this assertion builder, in order to facilitate a fluent API.

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

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
this assertion builder, in order to facilitate a fluent API.