@Test(expected = IntentNotResolvableException.class) public void launchApplicationUrl_withUnresolvableUrl_shouldThrowIntentNotResolvableException() throws Exception { final String url = "url_to_installed_app"; Intents.launchApplicationUrl(activityContext, Uri.parse(url)); final Intent startedActivity = ShadowApplication.getInstance().peekNextStartedActivity(); assertThat(startedActivity).isNull(); }
@Test public void launchApplicationUrl_withResolvableUrl_shouldOpenActivity() throws Exception { final String url = "url_to_installed_app"; makeUrlResolvable(url); Intents.launchApplicationUrl(activityContext, Uri.parse(url)); final Intent startedActivity = ShadowApplication.getInstance().peekNextStartedActivity(); assertThat(startedActivity).isNotNull(); }