mvrx-mocking / com.airbnb.mvrx.mocking / MockBehavior / InitialStateMocking

InitialStateMocking

enum class InitialStateMocking

Describes how a custom mocked state is applied to initialize a new ViewModel.

Enum Values

None

No mocked state is applied. The ViewModel initializes itself through normal means.

ForceMockExistingViewModel

Generally uses the same behavior as None, however, if an 'existingViewModel' is accessed and no previous instance exists this will take the default mock state off of the Fragment for that ViewModel and initialize the ViewModel with that state.

Partial

Initial view model state is taken from MockStateHolder and used in ViewModel creation, but that mocked state may be overridden either in the MavericksViewModelFactory or constructor of the ViewModel.

Full

Initial view model state is taken from MockStateHolder and used in ViewModel creation. Additionally, any changes to state during ViewModel initialization are forcibly overridden by the mocked state.