Skip to content

opensavvy.prepared.suite

Types

Prepared

class Prepared<out T>

Lazily-generated value unique to a test case.

PreparedDelegate

See prepared.

PreparedDsl

interface PreparedDsl

PreparedDslMarker

PreparedProvider

A Prepared is a lazily-created value that is bound to a test, such that multiple reads provide the same value.

Shared

class Shared<out T>

Pure, immutable lazy value which is shared between all tests.

SharedDelegate

class SharedDelegate<T>

See shared.

SharedProvider

class SharedProvider<T>

A Shared is a lazily-created value that is reused between tests.

SuiteDsl

interface SuiteDsl : PreparedDsl

A group of tests.

TestDsl

interface TestDsl : PreparedDsl

A test declaration.

TestEnvironment

Common utilities and features required for testing.

Time

class Time

Time control helper. See time.

Properties

Functions

prepared

fun <T> prepared(
    context: CoroutineContext = EmptyCoroutineContext, 
    display: Display = Display.Short, 
    block: suspend TestDsl.() -> T
): PreparedProvider<T>

Declares a lazily-prepared value which will be constructed by calling block during test execution.

fun <T> prepared(
    name: String, 
    context: CoroutineContext = EmptyCoroutineContext, 
    display: Display = Display.Short, 
    block: suspend TestDsl.() -> T
): Prepared<T>

Declares a lazily-prepared value called name which will be constructed by calling block during test execution.

runTestDsl

fun runTestDsl(
    name: String, 
    config: TestConfig, 
    block: suspend TestDsl.() -> Unit
): TestResult

Low-level primitive to execute a test declared as a TestDsl.

runTestDslSuspend

suspend fun TestScope.runTestDslSuspend(
    name: String, 
    config: TestConfig, 
    block: suspend TestDsl.() -> Unit
)

Low-level primitive to execute a test declared as a TestDsl, when already inside a TestScope.

shared

fun <T> shared(
    context: CoroutineContext = EmptyCoroutineContext, 
    display: Display = Display.Short, 
    block: suspend () -> T
): SharedProvider<T>

Declares a lazily-computed value that is constructed by calling block, and is then shared between all tests.

fun <T> shared(
    name: String, 
    context: CoroutineContext = EmptyCoroutineContext, 
    display: Display = Display.Short, 
    block: suspend () -> T
): Shared<T>

Declares a lazily-computer value called name that is constructed by calling block, and is then shared between all tests.