use of com.reactnativenavigation.mocks.TitleBarButtonCreatorMock 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());
}
use of com.reactnativenavigation.mocks.TitleBarButtonCreatorMock in project react-native-navigation by wix.
the class TitleBarButtonControllerTest method beforeEach.
@Override
public void beforeEach() {
Activity activity = newActivity();
titleBar = new ButtonBar(activity);
ButtonOptions button = createComponentButton();
uut = new ButtonController(activity, new ButtonPresenter(activity, button, new IconResolver(activity, ImageLoaderMock.mock())), button, new TitleBarButtonCreatorMock(), Mockito.mock(ButtonController.OnClickListener.class));
}
use of com.reactnativenavigation.mocks.TitleBarButtonCreatorMock 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();
}
Aggregations