AdAlertReporter { @Deprecated ArrayList<Uri> getEmailAttachments() { return mEmailAttachments; } AdAlertReporter(final Context context, final View view, final AdConfiguration adConfiguration); void send();  }
@Test public void constructor_shouldAddParametersTextFileToAttachmentArray() throws Exception { stub(context.getFilesDir()).toReturn(new File("filesDir")); stub(context.openFileOutput(any(String.class), any(int.class))).toReturn(mock(FileOutputStream.class)); subject = new AdAlertReporter(context, view, adConfiguration); emailAttachments = subject.getEmailAttachments(); Uri fileUri = Uri.fromFile(new File("filesDir/mp_adalert_parameters.txt")); assertThat(emailAttachments).contains(fileUri); }
@Test public void constructor_shouldAddBitmapToAttachmentArray() throws Exception { stub(context.getFilesDir()).toReturn(new File("filesDir")); stub(context.openFileOutput(any(String.class), any(int.class))).toReturn(mock(FileOutputStream.class)); subject = new AdAlertReporter(context, view, adConfiguration); emailAttachments = subject.getEmailAttachments(); Uri fileUri = Uri.fromFile(new File("filesDir/mp_adalert_screenshot.png")); assertThat(emailAttachments).contains(fileUri); }