MediaResolverHelper { boolean deleteMedia(@NonNull final Uri uri) { return context.getContentResolver().delete(uri, null, null) > 0; } @Inject  MediaResolverHelper(Context context, ExifHelper exifHelper, FileHelper fileHelper); @Nullable InputStream getInputStreamFromUri(@NonNull Uri uri); @Nullable ParcelFileDescriptor openFileDescriptor(@NonNull Uri uri); boolean removeDuplicateImage(@NonNull Uri uri);  }
@Test public void deleteMediaShouldReturnFalseIfNothingDeleted() { when(mockContentResolver.delete(mockUri, null, null)).thenReturn(0); boolean deleted = helper.deleteMedia(mockUri); assertFalse(deleted); }
@Test public void deleteMediaShouldReturnTrueIfDeleted() { when(mockContentResolver.delete(mockUri, null, null)).thenReturn(1); boolean deleted = helper.deleteMedia(mockUri); assertTrue(deleted); }