public void FolderComparison_DifferentFilesInFolders_FalseAndListOfDifferentFiles()
        {
            using (var temporaryFolder1 = new TemporaryFolder())
            using (var temporaryFolder2 = new TemporaryFolder())
            {
                temporaryFolder1.CreateFile("test1.txt");
                temporaryFolder1.CreateFile("test2.txt");
                temporaryFolder2.CreateFile("test1.txt");
                temporaryFolder2.CreateFile("test3.txt");

                IFolderComparisonReport folderComparisonReport = temporaryFolder1.Compare(temporaryFolder2, ReportOption.CollectDifferentFiles);
                CollectionAssert.AreEqual(new[] {"test2.txt"}, folderComparisonReport.Folder1Files);
                CollectionAssert.AreEqual(new[] {"test3.txt"}, folderComparisonReport.Folder2Files);
                Assert.That(folderComparisonReport.Equal, Is.False);
            }
        }
        public void FolderComparison_ExistsAndNotExistsFolders_False()
        {
            using (var temporaryFolder = new TemporaryFolder())
            {
                IFolder folder2 = new DataFolder(temporaryFolder.Folder + "\\" + "test2");

                IFolderComparisonReport report = temporaryFolder.Compare(folder2);
                Assert.That(report.Equal, Is.False);
            }
        }
 public void FolderComparison_EmptyAndEmptyFolders_True()
 {
     using (var temporaryFolder1 = new TemporaryFolder())
     using (var temporaryFolder2 = new TemporaryFolder())
     {
         IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
         Assert.That(report.Equal, Is.True);
     }
 }
        public void FolderComparison_FoldersWithSameSubFolders_True()
        {
            using (var temporaryFolder1 = new TemporaryFolder())
            using (var temporaryFolder2 = new TemporaryFolder())
            {
                temporaryFolder1.CreateFolder("test1");
                temporaryFolder2.CreateFolder("test1");

                IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
                Assert.That(report.Equal, Is.True);
            }
        }
        public void FolderComparison_FoldersWithSameSubFoldersButDifferentFiles_False()
        {
            using (var temporaryFolder1 = new TemporaryFolder())
            using (var temporaryFolder2 = new TemporaryFolder())
            {
                IFolder folder1 = temporaryFolder1.CreateFolder("test");
                IFolder folder2 = temporaryFolder2.CreateFolder("test");

                folder1.CreateFile("file_1");
                folder2.CreateFile("file_2");
                IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
                Assert.That(report.Equal, Is.False);
            }
        }
        public void FolderComparison_FoldersWithDifferentSubFolders_False()
        {
            using (var temporaryFolder1 = new TemporaryFolder())
            using (var temporaryFolder2 = new TemporaryFolder())
            {
                temporaryFolder1.CreateFolder("test1");
                temporaryFolder2.CreateFolder("test2");

                IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
                Assert.That(report.Equal, Is.False);
            }
        }
 public void FolderComparison_FoldersWith1DifferentFile_False()
 {
     using (var temporaryFolder1 = new TemporaryFolder())
     using (var temporaryFolder2 = new TemporaryFolder())
     {
         temporaryFolder1.CreateFile("file_1");
         temporaryFolder2.CreateFile("file_2");
         IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
         Assert.That(report.Equal, Is.False);
     }
 }
 public void FolderComparison_Folder1With1FileAndFolder2With2Files_False()
 {
     using (var temporaryFolder1 = new TemporaryFolder())
     using (var temporaryFolder2 = new TemporaryFolder())
     {
         temporaryFolder1.CreateFile("file1_1");
         temporaryFolder2.CreateFile("file2_1");
         temporaryFolder2.CreateFile("file2_2");
         IFolderComparisonReport report = temporaryFolder1.Compare(temporaryFolder2);
         Assert.That(report.Equal, Is.False);
     }
 }
        public void FolderComparison_FilesListNotFoundInFolderAndSubFolder_False()
        {
            using (var temporaryFolder = new TemporaryFolder())
            {
                temporaryFolder.CreateFile("file1.txt");
                temporaryFolder.CreateFile("file2.txt");
                IFolder subFolder = temporaryFolder.CreateFolder("subFolder");
                subFolder.CreateFile("subFolderFile1.dat");

                string[] filesList = new StringBuilder()
                    .AppendLine("file1.txt")
                    .AppendLine("file2.txt")
                    .AppendLine(@"subFolder\subFolderFile1.dat")
                    .AppendLine(@"subFolder\subFolderFile2.dat")
                    .ToString()
                    .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

                IFolderComparisonReport folderComparisonReport = temporaryFolder.Compare(filesList);
                Assert.That(folderComparisonReport.Equal, Is.False);
            }
        }
Ejemplo n.º 10
0
 public void FolderComparison_ExistsAndNullFolders_False()
 {
     using (var temporaryFolder = new TemporaryFolder())
     {
         IFolder nullFolder = null;
         IFolderComparisonReport report = temporaryFolder.Compare(nullFolder);
         Assert.That(report.Equal, Is.False);
     }
 }