TestResult

class TestResult(val dataStream: List<Transmission.Data>, val effectStream: List<Transmission.Effect>)

Contains the captured streams and provides assertion methods for test validation.

TestResult is provided as the receiver in test assertion blocks and gives access to all data and effects that were emitted during test execution. It provides various methods for finding, filtering, and asserting on the captured transmissions.

Parameters

dataStream

List of all data transmissions captured during test execution

effectStream

List of all effect transmissions captured during test execution

Constructors

Link copied to clipboard
constructor(dataStream: List<Transmission.Data>, effectStream: List<Transmission.Effect>)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T : Transmission.Data> allData(): List<T>

Returns all data transmissions of the specified type.

Link copied to clipboard

Returns all effect transmissions of the specified type.

Link copied to clipboard
inline fun <T : Transmission.Data> findAllData(predicate: (T) -> Boolean): List<T>

Finds all data transmissions of the specified type that match the predicate.

Link copied to clipboard
inline fun <T : Transmission.Effect> findAllEffects(predicate: (T) -> Boolean): List<T>

Finds all effect transmissions of the specified type that match the predicate.

Link copied to clipboard
inline fun <T : Transmission.Data> findData(predicate: (T) -> Boolean): T?

Finds the first data transmission of the specified type that matches the predicate.

Link copied to clipboard
inline fun <T : Transmission.Effect> findEffect(predicate: (T) -> Boolean): T?

Finds the first effect transmission of the specified type that matches the predicate.

Link copied to clipboard

Checks if any data transmission of the specified type exists in the captured stream.

Link copied to clipboard

Checks if any effect transmission of the specified type exists in the captured stream.

Link copied to clipboard
@JvmName(name = "lastDataWithType")
inline fun <T : Transmission.Data> lastData(): T?

Returns the last data transmission of the specified type.

Returns the last data transmission of any type.

Link copied to clipboard
@JvmName(name = "lastEffectWithType")
inline fun <T : Transmission.Effect> lastEffect(): T?

Returns the last effect transmission of the specified type.

Returns the last effect transmission of any type.

Link copied to clipboard

Returns the data transmission at the specified index.

Link copied to clipboard

Returns the effect transmission at the specified index.