@Test
public void shouldWipeExternalSdCardWhenRequested(){

    File root = Mockito.mock(File.class);
    File picturesDirectory = Mockito.mock(File.class);
    File pictureFile = Mockito.mock(File.class);
    File rootFile = Mockito.mock(File.class);
    File[] listFiles = new File[2];
    listFiles[0] = picturesDirectory;
    listFiles[1] = rootFile;
    File[] listFilesPictures = new File[1];
    listFilesPictures[0] = pictureFile;
    doReturn(listFiles).when(root).listFiles();
    doReturn(listFilesPictures).when(picturesDirectory).listFiles();
    doReturn(true).when(picturesDirectory).isDirectory();
    deviceService.wipeDirectory(root);
    verify(rootFile).delete();
    verify(pictureFile).delete();
    verify(picturesDirectory).delete();
}