FileSystemSelectionValidator { public boolean isSelectionValid() { return isValid; } FileSystemSelectionValidator(List<File> files); boolean isSelectionValid(); String getErrorMessage();  }
@Test public void shouldReturnFalseForAFileFromNonFileSystem() throws IOException { ShellFolder mockfolder = Mockito.mock(ShellFolder.class); when(mockfolder.isFileSystem()).thenReturn(false); FileSystemSelectionValidator validator = new FileSystemSelectionValidator(Arrays.asList(mockfolder)); Assert.assertFalse(validator.isSelectionValid()); }
@Test public void shouldReturnFalseWhenAnyOneFolderIsNonFileSystem() throws IOException { ShellFolder mockfolder = Mockito.mock(ShellFolder.class); when(mockfolder.isFileSystem()).thenReturn(false); File file = temporaryFolder.newFile("someFile"); FileSystemSelectionValidator validator = new FileSystemSelectionValidator(Arrays.asList(mockfolder, file)); Assert.assertFalse(validator.isSelectionValid()); }