コード例 #1
0
 @Test
 public void shouldLaunchCameraIntentOnButtonClick() {
   CreateServiceRequestActivity spy = spy(createServiceRequestActivity);
   spy.onCameraButtonClick(button);
   verify(spy)
       .startActivityForResult(
           any(Intent.class), eq(CreateServiceRequestActivity.CAPTURE_PHOTO_REQUEST_CODE));
 }
コード例 #2
0
  @Test
  public void shouldPopulateServiceSpinner() {
    createServiceRequestActivity.onCreate(null);

    Spinner serviceSpinner = (Spinner) getField(createServiceRequestActivity, "serviceSpinner");
    SpinnerAdapter adapter = serviceSpinner.getAdapter();
    assertThat(adapter, instanceOf(ServiceListSpinnerAdapter.class));
  }