@Test public void showHide() { RoboMenu menu = new RoboMenu(); navigator.onCreate(activity, null); navigator.onCreateOptionsMenu(menu); navigator.show(screen); verify(root).onHide(activity); verify(activity, times(2)).onNavigate(isA(ActionBarConfig.class)); assertThat(navigator.currentScreen()).isEqualTo(screen); reset(activity); navigator.hide(screen); assertThat(navigator.currentScreen()).isEqualTo(root); verify(screen).onHide(activity); verify(root, times(2)).onShow(activity); verify(activity).onNavigate(isA(ActionBarConfig.class)); }
@Test public void onCreateOptionsMenu() { RoboMenu menu = new RoboMenu(); menu.add("item0"); menu.add("item1"); navigator.onCreateOptionsMenu(menu); assertThat(menu.getItem(0).isVisible()).isFalse(); assertThat(menu.getItem(1).isVisible()).isFalse(); verify(root).onUpdateMenu(menu); }
@Test public void onPrepareOptionsMenu() { RoboMenu menu = new RoboMenu(); menu.add("item0"); menu.add("item1"); navigator.onPrepareOptionsMenu(menu); assertThat(menu.getItem(0).isVisible()).isFalse(); assertThat(menu.getItem(1).isVisible()).isFalse(); verify(root).onUpdateMenu(menu); }
@Before public void setup(){ a = createActivity(TestActivity.class); menu = new RoboMenu(a); }
@Before public void setup() { a = createActivity(MapActivity.class); a.mMenu = mock(MenuHandler.class); menu = new RoboMenu(a); }
@Before public void setup() { a = createActivity(OnOffActivity.class); a.mMenu = mock(MenuHandler.class); menu = new RoboMenu(a); }
@Before public void setup() { a = createActivity(SettingsActivity.class); a.mMenu = mock(MenuHandler.class); menu = new RoboMenu(a); }