Search in sources :

Example 81 with RoboMenuItem

use of org.robolectric.fakes.RoboMenuItem in project Detours-Android by TeamDetours.

the class Cafe_NavDrawer_ActivityTest method onOptionsItemSelectedRatings_DescIsTrue.

@Test
public void onOptionsItemSelectedRatings_DescIsTrue() throws Exception {
    MenuItem menuItem = new RoboMenuItem(R.id.ratings_desc);
    assertTrue(cafeActivity.onOptionsItemSelected(menuItem));
}
Also used : RoboMenuItem(org.robolectric.fakes.RoboMenuItem) MenuItem(android.view.MenuItem) RoboMenuItem(org.robolectric.fakes.RoboMenuItem) Test(org.junit.Test)

Example 82 with RoboMenuItem

use of org.robolectric.fakes.RoboMenuItem in project Detours-Android by TeamDetours.

the class Emergency_NavDrawer_ActivityTest method onNavigationItemSelected_MilesIsTrue.

@Test
public void onNavigationItemSelected_MilesIsTrue() throws Exception {
    MenuItem menuItem = new RoboMenuItem(R.id.nav_OneMile);
    assertTrue(EmergencyActivity.onNavigationItemSelected(menuItem));
}
Also used : RoboMenuItem(org.robolectric.fakes.RoboMenuItem) MenuItem(android.view.MenuItem) RoboMenuItem(org.robolectric.fakes.RoboMenuItem) Test(org.junit.Test)

Example 83 with RoboMenuItem

use of org.robolectric.fakes.RoboMenuItem in project Detours-Android by TeamDetours.

the class Emergency_NavDrawer_ActivityTest method onOptionsItemSelectedRatings_DescIsTrue.

@Test
public void onOptionsItemSelectedRatings_DescIsTrue() throws Exception {
    MenuItem menuItem = new RoboMenuItem(R.id.ratings_desc);
    assertTrue(EmergencyActivity.onOptionsItemSelected(menuItem));
}
Also used : RoboMenuItem(org.robolectric.fakes.RoboMenuItem) MenuItem(android.view.MenuItem) RoboMenuItem(org.robolectric.fakes.RoboMenuItem) Test(org.junit.Test)

Example 84 with RoboMenuItem

use of org.robolectric.fakes.RoboMenuItem in project Detours-Android by TeamDetours.

the class GasStation_NavDrawer_ActivityTest method onNavigationItemSelected_MilesIsTrue.

@Test
public void onNavigationItemSelected_MilesIsTrue() throws Exception {
    MenuItem menuItem = new RoboMenuItem(R.id.nav_OneMile);
    assertTrue(GasStationActivity.onNavigationItemSelected(menuItem));
}
Also used : RoboMenuItem(org.robolectric.fakes.RoboMenuItem) MenuItem(android.view.MenuItem) RoboMenuItem(org.robolectric.fakes.RoboMenuItem) Test(org.junit.Test)

Example 85 with RoboMenuItem

use of org.robolectric.fakes.RoboMenuItem in project Detours-Android by TeamDetours.

the class GasStation_NavDrawer_ActivityTest method onNavigationItemSelected_ElseIsFalse.

@Test
public void onNavigationItemSelected_ElseIsFalse() throws Exception {
    MenuItem menuItem = new RoboMenuItem(R.id.ratings_asc);
    assertFalse(GasStationActivity.onNavigationItemSelected(menuItem));
}
Also used : RoboMenuItem(org.robolectric.fakes.RoboMenuItem) MenuItem(android.view.MenuItem) RoboMenuItem(org.robolectric.fakes.RoboMenuItem) Test(org.junit.Test)

Aggregations

RoboMenuItem (org.robolectric.fakes.RoboMenuItem)127 Test (org.junit.Test)120 MenuItem (android.view.MenuItem)72 SlowTest (io.github.hidroh.materialistic.test.suite.SlowTest)23 TargetApi (android.annotation.TargetApi)18 PopupMenu (android.widget.PopupMenu)18 ShadowPopupMenu (org.robolectric.shadows.ShadowPopupMenu)18 RoboMenu (org.robolectric.fakes.RoboMenu)12 Context (android.content.Context)11 Intent (android.content.Intent)9 Before (org.junit.Before)7 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)6 SuppressLint (android.annotation.SuppressLint)4 WebView (android.webkit.WebView)3 TestItem (io.github.hidroh.materialistic.test.TestItem)3 ShadowWebView (io.github.hidroh.materialistic.test.shadow.ShadowWebView)3 IOException (java.io.IOException)3 ShadowActivity (org.robolectric.shadows.ShadowActivity)3 Bundle (android.os.Bundle)2 NonNull (android.support.annotation.NonNull)2