-
- All Implemented Interfaces:
-
androidx.lifecycle.LifecycleOwner,com.airbnb.mvrx.MavericksView
public interface MockableMavericksView implements MavericksView
-
-
Method Summary
Modifier and Type Method Description MavericksViewMocks<out MockableMavericksView, out Parcelable>provideMocks()Override this to provide the mock states that should be used for testing this view. UnitregisterMockPrinter()Register this view to listen for broadcast receiver intents for mock state printing. abstract LifecyclegetLifecycle()MavericksViewInternalViewModelgetMavericksViewInternalViewModel()StringgetMvrxViewId()LifecycleOwnergetSubscriptionLifecycleOwner()-
Methods inherited from class com.airbnb.mvrx.mocking.MockableMavericksView
collectLatest, invalidate, onAsync, onEach, onEach, onEach, onEach, onEach, onEach, onEach, onEach, postInvalidate, uniqueOnly -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
provideMocks
MavericksViewMocks<out MockableMavericksView, out Parcelable> provideMocks()
Override this to provide the mock states that should be used for testing this view.
It is intended that functions such as mockSingleViewModel be used to provide the value of this function, instead of instantiating MavericksViewMocks directly
You should NOT invoke this function directly. You can access the mocks for a view via MavericksViewMocks.getFrom instead.
For implementing this function, see:
-
registerMockPrinter
Unit registerMockPrinter()
Register this view to listen for broadcast receiver intents for mock state printing. This is safe to call multiple times for the same MavericksView.
Doing this allows the arguments for the view to be printed out. View model states will be printed out if MockableMavericks.initialize has been done.
This should be called when the view is created, so it is available to have its state printed. This is a no-op if MockableMavericks.enableMockPrinterBroadcastReceiver is disabled.
For more about mock printing, see MavericksPrintStateBroadcastReceiver
-
getLifecycle
abstract Lifecycle getLifecycle()
-
getMavericksViewInternalViewModel
MavericksViewInternalViewModel getMavericksViewInternalViewModel()
-
getMvrxViewId
String getMvrxViewId()
-
getSubscriptionLifecycleOwner
LifecycleOwner getSubscriptionLifecycleOwner()
-
-
-
-