Package 

Class FourViewModelMockBuilder

  • All Implemented Interfaces:
    com.airbnb.mvrx.mocking.DataClassSetDsl

    
    public final class FourViewModelMockBuilder<V extends MockableMavericksView, VM1 extends MavericksViewModel<S1>, S1 extends MavericksState, VM2 extends MavericksViewModel<S2>, S2 extends MavericksState, VM3 extends MavericksViewModel<S3>, S3 extends MavericksState, VM4 extends MavericksViewModel<S4>, S4 extends MavericksState, Args extends Parcelable>
    extends MockBuilder<V, Args>
                        
    • Method Summary

      Modifier and Type Method Description
      <ERROR CLASS> getMocks() A list of mocks to use when testing a view.
      List<List<MavericksMock<V, out Args>>> getMockGroups()
      final Unit state(String name, Function1<Args, Args> args, Function1<FourStatesBuilder<V, S1, VM1, S2, VM2, S3, VM3, S4, VM4>, Unit> statesBuilder) Provide state objects for each view model in the view.
      • Methods inherited from class com.airbnb.mvrx.mocking.FourViewModelMockBuilder

        args
      • Methods inherited from class com.airbnb.mvrx.mocking.MockBuilder

        invoke, set, setEmpty, setFalse, setLoading, setNetworkFailure, setNull, setTrue, setZero, success, validate, with
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMocks

         <ERROR CLASS> getMocks()

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

        At least one of mocks or mockGroups must be implemented.

      • state

         final Unit state(String name, Function1<Args, Args> args, Function1<FourStatesBuilder<V, S1, VM1, S2, VM2, S3, VM3, S4, VM4>, Unit> statesBuilder)

        Provide state objects for each view model in the view.

        Parameters:
        name - Describes the UI these states put the view in.
        args - The arguments that should be provided to the view.
        statesBuilder - A lambda that is used to define state objects for each view model.