ScriptableMavericksStateStore

class ScriptableMavericksStateStore<S : Any>(initialState: S) : ScriptableStateStore<S>

A MavericksStateStore which ignores standard calls to set. Instead it can be scripted via calls to next. This is intended to be used for tests only, and in particular UI tests where you wish to test how your UI code reacts to different ViewModel states. This is not as useful for unit testing your view model, as business logic in state reducers will not be used.

Constructors

ScriptableMavericksStateStore
Link copied to clipboard
fun <S : Any> ScriptableMavericksStateStore(initialState: S)

Functions

get
Link copied to clipboard
open override fun get(block: (S) -> Unit)
next
Link copied to clipboard
open override fun next(state: S)

Force the current state to be moved to the given value immediately.

set
Link copied to clipboard
open override fun set(stateReducer: S.() -> S)

Properties

flow
Link copied to clipboard
open override val flow: Flow<S>
state
Link copied to clipboard
open override var state: S