コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 public void DirectoryContainsFiles_InvalidPaths_Returns_False(string path)
 {
     Assert.IsFalse(FolderLibrary.DirectoryContainsFiles(path));
 }