strikt-core / strikt.api

Package strikt.api

Types

Assertion

Allows assertion implementations to determine a result.

interface Assertion

AtomicAssertion

An assertion of a single condition on a subject.

interface AtomicAssertion : Assertion

CompoundAssertion

An assertion composed of multiple conditions whose overall result is determined by some aggregation of those conditions' results.

interface CompoundAssertion : Assertion

CompoundAssertions

Returned by Assertion.Builder.compose allowing a bridge between evaluation of composed assertions and the determination of the overall result in the block parameter passed to then.

interface CompoundAssertions<T>

DescribeableBuilder

Extension of Assertion.Builder that enables the description of the assertion subject.

interface DescribeableBuilder<T> : Builder<T>

ExpectationBuilder

Receiver for expect providing functions that define assertion subjects and create assertion chains or blocks.

interface ExpectationBuilder

Functions

expect

Starts a block of assertions that will all be evaluated regardless of whether earlier ones fail. This is the entry-point for the assertion API.

fun expect(block: suspend ExpectationBuilder.() -> Unit): Unit

expectCatching

Start a chain of assertions over the result of action which may either be the value action returns or any exception it throws. This is the entry-point for the assertion API.

fun <T> expectCatching(action: suspend () -> T): DescribeableBuilder<Result<T>>

expectThat

Start a chain of assertions over subject. This is the entry-point for the assertion API.

fun <T> expectThat(subject: T): DescribeableBuilder<T>

Evaluate a block of assertions over subject. This is the entry-point for the assertion API.

fun <T> expectThat(subject: T, block: Builder<T>.() -> Unit): Unit

expectThrows

Asserts that actionthrows an exception of type E when executed.

fun <E : Throwable> expectThrows(action: suspend () -> Any?): Builder<E>