public void DirectoryContainsFiles_Containing_Nothing_Returns_False() { string directoryName = "DirectoryContainsFiles_Containing_Nothing_Returns_False"; _pathOriginal = Path.Combine(_assemblyFolder, directoryName); Directory.CreateDirectory(_pathOriginal); Assert.IsFalse(FolderLibrary.DirectoryContainsFiles(_pathOriginal)); }
public void DirectoryContainsFiles_Containing_Files_Returns_True() { string directoryName = "DirectoryContainsFiles_Containing_Files_Returns_True"; _pathOriginal = Path.Combine(_assemblyFolder, directoryName); Directory.CreateDirectory(_pathOriginal); string fileName = "Sample1.txt"; var myFile = File.Create(Path.Combine(_pathOriginal, fileName)); myFile.Close(); Assert.IsTrue(FolderLibrary.DirectoryContainsFiles(_pathOriginal)); }
public void DirectoryContainsFiles_Containing_Only_Directories_Returns_False() { string directoryName = "DirectoryContainsFiles_Containing_Only_Directories_Returns_False"; _pathOriginal = Path.Combine(_assemblyFolder, directoryName); Directory.CreateDirectory(_pathOriginal); string subDirectoryName = "subdirectory1"; string subPath = Path.Combine(_pathOriginal, subDirectoryName); Directory.CreateDirectory(subPath); Assert.IsFalse(FolderLibrary.DirectoryContainsFiles(_pathOriginal)); }
public void DirectoryContainsFiles_Containing_Directories_That_Contain_Files_Returns_False() { string directoryName = "DirectoryContainsFiles_Containing_Directories_That_Contain_Files_Returns_False"; _pathOriginal = Path.Combine(_assemblyFolder, directoryName); Directory.CreateDirectory(_pathOriginal); string subDirectoryName = "subdirectory1"; string subPath = Path.Combine(_pathOriginal, subDirectoryName); Directory.CreateDirectory(subPath); string fileName = "Sample1.txt"; var myFile = File.Create(Path.Combine(subPath, fileName)); myFile.Close(); Assert.IsFalse(FolderLibrary.DirectoryContainsFiles(_pathOriginal)); }
public void DirectoryContainsFiles_InvalidPaths_Returns_False(string path) { Assert.IsFalse(FolderLibrary.DirectoryContainsFiles(path)); }