Java 类org.robolectric.fakes.RoboMenu 实例源码

项目:magellan    文件:NavigatorTest.java   
@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));
}
项目:magellan    文件:NavigatorTest.java   
@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);
}
项目:magellan    文件:NavigatorTest.java   
@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);
}
项目:whereat-android    文件:MenuHandlerTest.java   
@Before
public void setup(){
    a = createActivity(TestActivity.class);
    menu = new RoboMenu(a);
}
项目:whereat-android    文件:MapActivityTest.java   
@Before
public void setup() {
    a = createActivity(MapActivity.class);
    a.mMenu = mock(MenuHandler.class);
    menu = new RoboMenu(a);
}
项目:whereat-android    文件:OnOffActivityTest.java   
@Before
public void setup() {
    a = createActivity(OnOffActivity.class);
    a.mMenu = mock(MenuHandler.class);
    menu = new RoboMenu(a);
}
项目:whereat-android    文件:SettingsActivityTest.java   
@Before
public void setup() {
    a = createActivity(SettingsActivity.class);
    a.mMenu = mock(MenuHandler.class);
    menu = new RoboMenu(a);
}