@Implementation protected static boolean isExternalStorageRemovable() { final Boolean exists = STORAGE_REMOVABLE.get(getExternalStorageDirectory()); return exists != null ? exists : false; }
@Implementation public static boolean isExternalStorageRemovable() { final Boolean exists = STORAGE_REMOVABLE.get(getExternalStorageDirectory()); return exists != null ? exists : false; }
@Implementation public static boolean isExternalStorageRemovable() { final Boolean exists = STORAGE_REMOVABLE.get(getExternalStorageDirectory()); return exists != null ? exists : false; }
@Implementation public static boolean isExternalStorageRemovable() { final Boolean exists = STORAGE_REMOVABLE.get(getExternalStorageDirectory()); return exists != null ? exists : false; }
@Implementation protected static boolean isExternalStorageRemovable() { final Boolean exists = STORAGE_REMOVABLE.get(getExternalStorageDirectory()); return exists != null ? exists : false; }
@Test public void shouldMakeDirectory() throws Exception { File rootDirectory = ShadowEnvironment.getExternalStorageDirectory(); String folderName = "folderName"; sut.create(rootDirectory, folderName) .subscribeOn(Schedulers.trampoline()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(mockObserver); ArgumentCaptor<File> argumentCaptor = ArgumentCaptor.forClass(File.class); verify(mockObserver).onNext(argumentCaptor.capture()); verify(mockObserver).onComplete(); assertEquals(rootDirectory.toString() + File.separator + folderName, argumentCaptor.getValue().getAbsolutePath()); } }
@Test public void shouldThroughDirectoryExistsException() throws Exception { File rootDirectory = ShadowEnvironment.getExternalStorageDirectory(); String folderName = "folderName"; createDirectory(rootDirectory, folderName); sut.create(rootDirectory, folderName) .subscribeOn(Schedulers.trampoline()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(mockObserver); verify(mockObserver).onError(any(DirectoryExistsException.class)); verify(mockObserver, never()).onComplete(); }