Esempio n. 1
0
        static void Main(string[] args)
        {
            string samplePath = @"H:\_BILDER";
            IFileDuplicateCheck duplicateChecker = new FileDuplicateCheck();
            List <IDuplicate>   duplicates       = duplicateChecker.LookupCandidate(samplePath, FileCompareMode.FileSizeFileName).ToList();

            Console.ReadKey();
        }
        public void LookupCandidate_SingleFile_NeverReturnsAsDuplicate()
        {
            //ARRANGE
            IFileDuplicateCheck fileDuplicateChecker = new FileDuplicateCheck();
            //ACT
            IEnumerable <IDuplicate> result = fileDuplicateChecker.LookupCandidate(@"TestDirectory", Model.FileCompareMode.FileSizeFileName);

            //ASSERT
            Assert.IsTrue(!result.Any(x => x.DuplicateObjects.Any(y => y.FileName.Equals("SINGLE_FILE.txt"))));
        }
        public void LookupCandidate_ModeFileSizeName_Returns4Duplicates()
        {
            //ARRANGE
            IFileDuplicateCheck fileDuplicateChecker = new FileDuplicateCheck();
            //ACT
            IEnumerable <IDuplicate> result = fileDuplicateChecker.LookupCandidate(@"TestDirectory", Model.FileCompareMode.FileSizeFileName);

            //ASSERT
            Assert.IsTrue(result.Count() == 4);
        }