use of com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.ViewControllerOverlay in project react-native-navigation by wix.
the class ViewControllerTest method onChildViewAdded_delegatesToYellowBoxDelegate.
@Test
public void onChildViewAdded_delegatesToYellowBoxDelegate() {
View child = new View(activity);
ViewGroup view = new FrameLayout(activity);
ViewController vc = new ViewController(activity, "", yellowBoxDelegate, new Options(), new ViewControllerOverlay(activity)) {
@Override
public ViewGroup createView() {
return view;
}
@Override
public void sendOnNavigationButtonPressed(String buttonId) {
}
@Override
public String getCurrentComponentName() {
return null;
}
};
vc.onChildViewAdded(view, child);
verify(yellowBoxDelegate).onChildViewAdded(view, child);
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.ViewControllerOverlay in project react-native-navigation by wix.
the class ViewControllerTest method canOverrideViewCreation.
@Test
public void canOverrideViewCreation() {
final FrameLayout otherView = new FrameLayout(activity);
yellowBoxDelegate = spy(new YellowBoxDelegate(activity));
ViewController myController = new ViewController(activity, "vc", yellowBoxDelegate, new Options(), new ViewControllerOverlay(activity)) {
@Override
public FrameLayout createView() {
return otherView;
}
@Override
public void sendOnNavigationButtonPressed(String buttonId) {
}
@Override
public String getCurrentComponentName() {
return null;
}
};
assertThat(myController.getView()).isEqualTo(otherView);
}
Aggregations