public void ShouldDetectDuplicates() { var directoryPath = SetupTests(); var duplicates = service.CollectCandidates(directoryPath).ToList(); duplicates.Count.ShouldBe(2); duplicates.ShouldContain(x => x.FilePaths.Count() == 3 && x.FilePaths.All(p => p.EndsWith("foo.txt"))); duplicates.ShouldContain(x => x.FilePaths.Count() == 2 && x.FilePaths.All(p => p.EndsWith("bar.txt"))); }
private void PerformFirstPass(string path, ComparisonMode mode) { var duplicateFiles = duplicateDetectionService.CollectCandidates(path, mode).ToList(); if (duplicateFiles.Any()) { PerformSecondPass(duplicateFiles, path, mode); } else { System.Console.WriteLine($"No duplicate files found in {path} for mode ${mode} in first pass."); } }
public void ShouldDetectDuplicatesWithSameNameAndSizeInDefaultMode() { new FileCrawlerMockBuilder() .WithSameName() .WithSameSize() .Build(fileCrawler); var duplicates = service.CollectCandidates("path"); duplicates.Count().ShouldBe(1); }