Search in sources :

Example 1 with IconResolverFake

use of com.reactnativenavigation.fakes.IconResolverFake in project react-native-navigation by wix.

the class ButtonPresenterTest method initUUt.

private void initUUt(ImageLoader imageLoaderMock) {
    IconResolverFake iconResolver = new IconResolverFake(activity, imageLoaderMock);
    uut = new ButtonPresenter(activity, button, iconResolver);
    buttonController = new ButtonController(activity, uut, button, mock(TitleBarButtonCreator.class), mock(ButtonController.OnClickListener.class));
}
Also used : IconResolverFake(com.reactnativenavigation.fakes.IconResolverFake) ButtonController(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController) ButtonPresenter(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter)

Example 2 with IconResolverFake

use of com.reactnativenavigation.fakes.IconResolverFake in project react-native-navigation by wix.

the class TopBarButtonControllerTest method beforeEach.

@Override
public void beforeEach() {
    button = new ButtonOptions();
    final Activity activity = newActivity();
    TitleBarButtonCreatorMock buttonCreatorMock = new TitleBarButtonCreatorMock();
    stackController = spy(TestUtils.newStackController(activity).build());
    stackController.getView().layout(0, 0, 1080, 1920);
    stackController.getTopBar().layout(0, 0, 1080, 200);
    getTitleBar().layout(0, 0, 1080, 200);
    optionsPresenter = spy(new ButtonPresenter(activity, button, new IconResolverFake(activity, ImageLoaderMock.mock())));
    uut = new ButtonController(activity, optionsPresenter, button, buttonCreatorMock, (buttonId) -> {
    });
    stackController.ensureViewIsCreated();
}
Also used : IconResolverFake(com.reactnativenavigation.fakes.IconResolverFake) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Text(com.reactnativenavigation.options.params.Text) Java6Assertions.assertThat(org.assertj.core.api.Java6Assertions.assertThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Colour(com.reactnativenavigation.options.params.Colour) ButtonBar(com.reactnativenavigation.views.stack.topbar.titlebar.ButtonBar) Mockito.spy(org.mockito.Mockito.spy) MenuItem(android.view.MenuItem) TitleBarButtonCreatorMock(com.reactnativenavigation.mocks.TitleBarButtonCreatorMock) NullText(com.reactnativenavigation.options.params.NullText) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Bool(com.reactnativenavigation.options.params.Bool) ButtonOptions(com.reactnativenavigation.options.ButtonOptions) BaseTest(com.reactnativenavigation.BaseTest) ButtonPresenter(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter) Number(com.reactnativenavigation.options.params.Number) ButtonController(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) Mockito.verify(org.mockito.Mockito.verify) Color(android.graphics.Color) IconResolverFake(com.reactnativenavigation.fakes.IconResolverFake) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) TestUtils(com.reactnativenavigation.TestUtils) Activity(android.app.Activity) ImageLoaderMock(com.reactnativenavigation.mocks.ImageLoaderMock) ButtonOptions(com.reactnativenavigation.options.ButtonOptions) ButtonController(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController) ButtonPresenter(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter) Activity(android.app.Activity) TitleBarButtonCreatorMock(com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)

Aggregations

IconResolverFake (com.reactnativenavigation.fakes.IconResolverFake)2 ButtonController (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController)2 ButtonPresenter (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter)2 Activity (android.app.Activity)1 Color (android.graphics.Color)1 MenuItem (android.view.MenuItem)1 BaseTest (com.reactnativenavigation.BaseTest)1 TestUtils (com.reactnativenavigation.TestUtils)1 ImageLoaderMock (com.reactnativenavigation.mocks.ImageLoaderMock)1 TitleBarButtonCreatorMock (com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)1 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)1 Bool (com.reactnativenavigation.options.params.Bool)1 Colour (com.reactnativenavigation.options.params.Colour)1 NullText (com.reactnativenavigation.options.params.NullText)1 Number (com.reactnativenavigation.options.params.Number)1 Text (com.reactnativenavigation.options.params.Text)1 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)1 ButtonBar (com.reactnativenavigation.views.stack.topbar.titlebar.ButtonBar)1 Java6Assertions.assertThat (org.assertj.core.api.Java6Assertions.assertThat)1 Test (org.junit.Test)1