-
public final class ViewMockerKt
-
-
Method Summary
Modifier and Type Method Description final static <V extends MockableMavericksView> List<MockedViewProvider<V>>getMockVariants(String viewClassName, Function2<Class<V>, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)See getMockVariantsProvides mocks for the view specified by the fully qualified name of its class. final static <V extends MockableMavericksView> List<MockedViewProvider<V>>getMockVariants(Class<V> viewClass, Function2<Class<V>, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)See getMockVariantsProvides mocks for the view specified by the given class. final static <V extends MockableMavericksView, A extends Parcelable> List<MockedViewProvider<V>>getMockVariants(Function2<A, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)Get all of the mocks declared for a MavericksView. final static <T extends Fragment, MockableMavericksView> List<MockedViewProvider<T>>mockVariants()Helper for getting all mock variants off of a Fragment. final static <T extends MockableMavericksView> MockedViewProvider<T>forDefaultState(List<MockedViewProvider<T>> $self)Helper for pulling the default state mock out of a list of mocks. final static <T extends MockableMavericksView> MockedViewProvider<T>forDefaultInitialization(List<MockedViewProvider<T>> $self)Helper for pulling the default initialization mock out of a list of mocks. -
-
Method Detail
-
getMockVariants
final static <V extends MockableMavericksView> List<MockedViewProvider<V>> getMockVariants(String viewClassName, Function2<Class<V>, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)
See getMockVariants
Provides mocks for the view specified by the fully qualified name of its class.
- Parameters:
viewClassName- The fully qualified name of the view's class.viewProvider- Creates an instance of the view from the view class.
-
getMockVariants
final static <V extends MockableMavericksView> List<MockedViewProvider<V>> getMockVariants(Class<V> viewClass, Function2<Class<V>, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)
See getMockVariants
Provides mocks for the view specified by the given class.
- Parameters:
viewClass- The Java class representing the MavericksViewviewProvider- Creates an instance of the view from the view class.
-
getMockVariants
final static <V extends MockableMavericksView, A extends Parcelable> List<MockedViewProvider<V>> getMockVariants(Function2<A, Bundle, V> viewProvider, EmptyMavericksViewMocks emptyMockPlaceholder, Integer mockGroupIndex)
Get all of the mocks declared for a MavericksView. The returned list of MockedViewProvider has one entry representing each mock in the view, which can be used to create a view mocked with that state and arguments.
- Parameters:
viewProvider- Return an instance of the MavericksView that is being mocked.emptyMockPlaceholder- If you use a custom object to represent that a MavericksView legitimately has no mocks then specify it here.mockGroupIndex- If the mocks are declared with combineMocks then if an index is passed only the mocks in that group index will be returned.
-
mockVariants
final static <T extends Fragment, MockableMavericksView> List<MockedViewProvider<T>> mockVariants()
Helper for getting all mock variants off of a Fragment. It is an error to call this if the Fragment does not define any mocks.
-
forDefaultState
final static <T extends MockableMavericksView> MockedViewProvider<T> forDefaultState(List<MockedViewProvider<T>> $self)
Helper for pulling the default state mock out of a list of mocks.
-
forDefaultInitialization
final static <T extends MockableMavericksView> MockedViewProvider<T> forDefaultInitialization(List<MockedViewProvider<T>> $self)
Helper for pulling the default initialization mock out of a list of mocks.
-
-
-
-