prepared

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

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

The prepared value returned by this function is automatically named after the variable it is stored in.

For more information, see Prepared.

Example

val randomEmail by prepared { "my-account-${random.nextInt()}@mail.com" }

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

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

For more information, see Prepared.

Example

val randomEmail = prepared("A randomized email address") { "my-account-${random.nextInt()}@mail.com" }