RealOrbitTestContext

Constructors

Link copied to clipboard
constructor(containerHost: CONTAINER_HOST, initialState: STATE?, emissions: ReceiveTurbine<Item<STATE, SIDE_EFFECT>>)

Properties

Link copied to clipboard
open override val containerHost: CONTAINER_HOST

Functions

Link copied to clipboard
open suspend override fun awaitItem(): Item<STATE, SIDE_EFFECT>

Return the next item received. This function will suspend if no items have been received.

Link copied to clipboard
open suspend override fun awaitSideEffect(): SIDE_EFFECT

Return the next side effect received. This function will suspend if no side effects have been received.

Link copied to clipboard
open suspend override fun awaitState(): STATE

Return the next state received. This function will suspend if no states have been received.

Link copied to clipboard
open suspend override fun cancelAndIgnoreRemainingItems()

Finish this test and ignore any events which have already been received. This also cancels any in-progress intents.

Link copied to clipboard
open suspend override fun expectInitialState()

Sanity check assertion. Checks if the initial state is emitted and matches the initial state defined for the production container (or the one specified in the test).

Link copied to clipboard
open suspend override fun expectNoItems()

Assert there are no unconsumed items

Link copied to clipboard
open suspend override fun expectSideEffect(expected: SIDE_EFFECT)

Awaits for a side effect and checks if it matches the expected side effect

Link copied to clipboard
open suspend override fun expectState(expected: STATE)

Awaits for a state and checks if it matches the expected state.

open suspend override fun expectState(expectedChange: STATE.() -> STATE)

Awaits for a state and checks if it matches the expected state change from the previous state.

Link copied to clipboard
open override fun runOnCreate(): Job

Invoke onCreate lambda for the ContainerHost.

Link copied to clipboard
open suspend override fun skipItems(count: Int)

Assert that count items were received and ignore them. This function will suspend if no items have been received.