fun state(name: String, args: (Args.() -> Args)? = null, stateBuilder: S.() -> S): Unit
Provide a state object via the lambda for the view model being mocked. The receiver of the lambda is the default state provided in the top level mock method. For simplicity you can modify the receiver directly.
The DSL provided by DataClassSetDsl can be used for simpler state modification.
Mock variations should test alterations to the "default" state, with each variant testing a minimal difference (ideally only one change). For example, a variant may test that a single property is null or empty.
name - Describes the UI the state puts the view in. Should be unique.
args - The arguments that should be provided to the view.
This is only useful if the view accesses arguments directly to get data that is not provided in the view model state.
In other cases it should be omitted. By default the args you set as default in the top level mock method will be used.
The receiver of the lambda is the default args.
stateBuilder - A lambda whose return object is the state for this mock. The lambda receiver is the default state.