Ejemplo n.º 1
0
  @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();
  }
Ejemplo n.º 2
0
  @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();
  }