TestMosaic

Assertions and ordinary Mosaic composition within TestMosaicBuilder.withMosaic. This receiver delegates to the scoped runtime and owns no coroutine engine. Do not retain it after the execution block returns.

Properties

Link copied to clipboard
open override val canvas: Canvas

Functions

Link copied to clipboard
suspend fun <V> assertEquals(tile: Tile<V>, expected: V)

Asserts that a Tile returns the expected value.

suspend fun <K : Any, V> assertEquals(tile: MultiTile<K, V>, keys: Collection<K>, expected: Map<K, V>)

Asserts that a MultiTile returns the expected values for the given keys.

suspend fun <V> assertEquals(tile: Tile<V>, expected: V, message: String)

Asserts that a Tile returns the expected value with a custom failure message.

suspend fun <K : Any, V> assertEquals(tile: MultiTile<K, V>, keys: List<K>, expected: Map<K, V>, message: String)

Asserts that a MultiTile returns the expected values for the given keys with a custom failure message.

Link copied to clipboard
suspend fun assertThrows(tile: Tile<*>, expectedException: KClass<out Throwable>): Throwable

Asserts that a Tile throws the expected exception when retrieved.

suspend fun <K : Any> assertThrows(tile: MultiTile<K, *>, keys: List<K>, expectedException: KClass<out Throwable>): Throwable

Asserts that a MultiTile throws the expected exception when retrieved with the given keys.

suspend fun assertThrows(tile: Tile<*>, expectedException: KClass<out Throwable>, message: String): Throwable

Asserts that a Tile throws the expected exception with a custom failure message.

Link copied to clipboard
open override fun <V> composeAsync(tile: Tile<V>): Deferred<V>
open override fun <K : Any, V> composeAsync(tile: MultiTile<K, V>, keys: Collection<K>): Map<K, Deferred<V>>

Inherited functions

Link copied to clipboard
open suspend fun <V> compose(tile: Tile<V>): V
open suspend fun <K : Any, V> compose(tile: MultiTile<K, V>, key: K): V
open suspend fun <K : Any, V> compose(tile: MultiTile<K, V>, keys: Collection<K>): Map<K, V>
Link copied to clipboard
open fun <K : Any, V> composeAsync(tile: MultiTile<K, V>, key: K): Deferred<V>