mvrx-mocking / com.airbnb.mvrx.mocking / MavericksViewMocks

MavericksViewMocks

open class MavericksViewMocks<V : MockableMavericksView, Args : Parcelable>

Defines a set of mocks for a Mavericks view.

Use helper functions such as mockSingleViewModel to create this, instead of creating it directly.

Properties

mockGroups

open val mockGroups: List<List<MavericksMock<V, out Args>>>

An optional breakdown of mocks to categorize them into groups.

mocks

open val mocks: List<MavericksMock<V, out Args>>

A list of mocks to use when testing a view. Each mock represents a unique state to be tested.

Functions

validate

fun validate(viewName: String): Unit

Companion Object Functions

allowCreationForTesting

fun <R> allowCreationForTesting(block: () -> R): R

Exposed for internal tests to allow us to workaround the requirement that this class can only be created via getFrom.

getFrom

fun getFrom(view: MockableMavericksView): MavericksViewMocks<out MockableMavericksView, out Parcelable>

Retrieves the mocks from a view provided by MockableMavericksView.provideMocks.

Inheritors

EmptyMavericksViewMocks

open class EmptyMavericksViewMocks : MavericksViewMocks<MockableMavericksView, Nothing>

MockBuilder

open class MockBuilder<V : MockableMavericksView, Args : Parcelable> : MavericksViewMocks<V, Args>, DataClassSetDsl