Skip to content

Instantly share code, notes, and snippets.

@brettwold
Last active September 16, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettwold/4f3817b35b410089268f to your computer and use it in GitHub Desktop.
Save brettwold/4f3817b35b410089268f to your computer and use it in GitHub Desktop.
Robolectric test for AlertDialog display
public class AlertTest {
@Test
public void check_alert() {
AlertDialog alert = ShadowAlertDialog.getLatestAlertDialog();
assertNotNull(alert);
ShadowAlertDialog sAlert = Robolectric.shadowOf(alert);
assertThat(sAlert.getTitle().toString(), is(Robolectric.application.getString(R.string.adb_warning_title)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment