Search in sources :

Example 1 with TypefaceLoaderMock

use of com.reactnativenavigation.mocks.TypefaceLoaderMock in project react-native-navigation by wix.

the class ButtonSpanTest method beforeEach.

@Override
public void beforeEach() {
    button = createButton();
    activity = newActivity();
    uut = new ButtonSpan(activity, button, new TypefaceLoaderMock());
}
Also used : ButtonSpan(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonSpan) TypefaceLoaderMock(com.reactnativenavigation.mocks.TypefaceLoaderMock)

Example 2 with TypefaceLoaderMock

use of com.reactnativenavigation.mocks.TypefaceLoaderMock in project react-native-navigation by wix.

the class BottomTabPresenterTest method createBottomTabs.

private void createBottomTabs(Options tab1Options, Options tab2Options, Options tab3Options) {
    childRegistry = new ChildControllersRegistry();
    bottomTabs = Mockito.mock(BottomTabs.class);
    child1 = spy(new SimpleViewController(activity, childRegistry, "child1", tab1Options));
    child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
    child3 = spy(new SimpleViewController(activity, childRegistry, "child2", tab3Options));
    tabs = Arrays.asList(child1, child2, child3);
    uut = new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new TypefaceLoaderMock(), new Options());
    uut.bindView(bottomTabs);
    uut.setDefaultOptions(new Options());
}
Also used : BottomTabs(com.reactnativenavigation.views.bottomtabs.BottomTabs) Options(com.reactnativenavigation.options.Options) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController) TypefaceLoaderMock(com.reactnativenavigation.mocks.TypefaceLoaderMock)

Example 3 with TypefaceLoaderMock

use of com.reactnativenavigation.mocks.TypefaceLoaderMock in project react-native-navigation by wix.

the class TestUtils method newStackController.

public static StackControllerBuilder newStackController(Activity activity) {
    TopBarController topBarController = new TopBarController() {

        @Override
        protected TopBar createTopBar(@NonNull Context context, @NonNull StackLayout stackLayout) {
            TopBar topBar = super.createTopBar(context, stackLayout);
            topBar.layout(0, 0, 1000, UiUtils.getTopBarHeight(context));
            return topBar;
        }
    };
    return new StackControllerBuilder(activity, Mockito.mock(EventEmitter.class)).setId("stack" + CompatUtils.generateViewId()).setChildRegistry(new ChildControllersRegistry()).setTopBarController(topBarController).setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TitleBarButtonCreatorMock(), new IconResolver(activity, new ImageLoader()), new TypefaceLoaderMock(), new RenderChecker(), new Options())).setInitialOptions(new Options());
}
Also used : Context(android.content.Context) Options(com.reactnativenavigation.options.Options) IconResolver(com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) TitleBarButtonCreatorMock(com.reactnativenavigation.mocks.TitleBarButtonCreatorMock) TypefaceLoaderMock(com.reactnativenavigation.mocks.TypefaceLoaderMock) TopBarBackgroundViewCreatorMock(com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock) TitleBarReactViewCreatorMock(com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock) NonNull(androidx.annotation.NonNull) StackLayout(com.reactnativenavigation.views.stack.StackLayout) StackPresenter(com.reactnativenavigation.viewcontrollers.stack.StackPresenter) TopBar(com.reactnativenavigation.views.stack.topbar.TopBar) StackControllerBuilder(com.reactnativenavigation.viewcontrollers.stack.StackControllerBuilder) ImageLoader(com.reactnativenavigation.utils.ImageLoader) TopBarController(com.reactnativenavigation.viewcontrollers.stack.topbar.TopBarController) RenderChecker(com.reactnativenavigation.utils.RenderChecker)

Aggregations

TypefaceLoaderMock (com.reactnativenavigation.mocks.TypefaceLoaderMock)3 Options (com.reactnativenavigation.options.Options)2 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)2 Context (android.content.Context)1 NonNull (androidx.annotation.NonNull)1 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)1 TitleBarButtonCreatorMock (com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)1 TitleBarReactViewCreatorMock (com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock)1 TopBarBackgroundViewCreatorMock (com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock)1 ImageLoader (com.reactnativenavigation.utils.ImageLoader)1 RenderChecker (com.reactnativenavigation.utils.RenderChecker)1 StackControllerBuilder (com.reactnativenavigation.viewcontrollers.stack.StackControllerBuilder)1 StackPresenter (com.reactnativenavigation.viewcontrollers.stack.StackPresenter)1 TopBarController (com.reactnativenavigation.viewcontrollers.stack.topbar.TopBarController)1 ButtonSpan (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonSpan)1 IconResolver (com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver)1 BottomTabs (com.reactnativenavigation.views.bottomtabs.BottomTabs)1 StackLayout (com.reactnativenavigation.views.stack.StackLayout)1 TopBar (com.reactnativenavigation.views.stack.topbar.TopBar)1