CircuitReceiveTurbine

interface CircuitReceiveTurbine<UiState : CircuitUiState> : ReceiveTurbine<UiState> (source)

A Circuit-specific extension to ReceiveTurbine with extra helper functions for Circuit testing.

This implementation of ReceiveTurbine slightly alters the behavior of awaitItem by only emitting items that are different from the previously emitted item.

Functions

Link copied to clipboard
abstract fun asChannel(): ReceiveChannel<UiState>
Link copied to clipboard
abstract suspend fun awaitComplete()
Link copied to clipboard
abstract suspend fun awaitError(): Throwable
Link copied to clipboard
abstract suspend fun awaitEvent(): Event<UiState>
Link copied to clipboard
abstract suspend fun awaitItem(): UiState
Link copied to clipboard
abstract suspend fun awaitUnchanged()

Awaits the next item and asserts that it is unchanged from the previous emission. Essentially this is a sort of escape-hatch from the altered "distinct until changed" behavior of awaitItem in this implementation and can be used to more or less assert no change in state after the next recomposition.

Link copied to clipboard
abstract suspend fun cancel()
Link copied to clipboard
abstract suspend fun cancelAndConsumeRemainingEvents(): List<Event<UiState>>
Link copied to clipboard
abstract suspend fun cancelAndIgnoreRemainingEvents()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun expectNoEvents()
Link copied to clipboard
abstract suspend fun skipItems(count: Int)