Test DatePickerDialog with robolectric
I'm trying to test date picker behavior with robolectric. @Test public void shouldSetStartedOnDate() { activity.findViewById(R.id.cruise_form_pick_started_on_button).performClick(); DatePickerDialog dialog = (DatePickerDialog) ShadowDatePickerDialog.getLatestDialog(); assertThat(dialog.isShowing(), is(true)); dialog.updateDate(2013, 3, 13); ShadowDialog shadowDialog = Robolectric.shadowOf(dialog); shadowDialog.clickOnText("Done"); assertThat(dialog.isShowing(), is(false)); TextView startedOnText = (TextView) activity.findViewById(R.id.cruise_form_started_on); assertThat(startedOnText.getText()