use of io.github.hidroh.materialistic.test.TestListActivity in project materialistic by hidroh.
the class AppUtilsTest method testFullscreenButton.
@Test
public void testFullscreenButton() {
ActivityController<TestListActivity> controller = Robolectric.buildActivity(TestListActivity.class);
TestListActivity activity = controller.create().get();
FloatingActionButton fab = new FloatingActionButton(activity);
AppUtils.toggleFabAction(fab, null, false);
fab.performClick();
assertThat(shadowOf(LocalBroadcastManager.getInstance(activity)).getSentBroadcastIntents()).isNotEmpty();
controller.destroy();
}
use of io.github.hidroh.materialistic.test.TestListActivity in project materialistic by hidroh.
the class AppUtilsTest method testOpenExternalComment.
@Test
public void testOpenExternalComment() {
ActivityController<TestListActivity> controller = Robolectric.buildActivity(TestListActivity.class);
TestListActivity activity = controller.create().get();
AppUtils.openExternal(activity, mock(PopupMenu.class), new View(activity), new TestHnItem(1), null);
assertNull(ShadowAlertDialog.getLatestAlertDialog());
AppUtils.openExternal(activity, mock(PopupMenu.class), new View(activity), new TestHnItem(1) {
@Override
public String getUrl() {
return String.format(HackerNewsClient.WEB_ITEM_PATH, "1");
}
}, null);
assertNull(ShadowAlertDialog.getLatestAlertDialog());
controller.destroy();
}
Aggregations