public void Test1_FileSeeker_ByPath()
        {
            IFilesSeeker filesSeeker = new FilesSeeker();
            var          result      = filesSeeker.ByPath(TestRunDirectoryPath);

            var countOfFiles   = result.Count;
            var expectedResult = CountOfOriginFiles * 6;


            Assert.AreEqual(expectedResult, countOfFiles);
        }
        public void Test2_FileSeeker_ByPath_And_ByExtension()
        {
            IFilesSeeker filesSeeker = new FilesSeeker();

            if (!Directory.Exists(TestRunDirectoryPath))
            {
                Setup();
            }


            var result = filesSeeker.ByPath(TestRunDirectoryPath);

            var countOfFiles   = result.Count;
            var expectedResult = CountOfOriginFiles * 6;


            Assert.AreEqual(expectedResult, countOfFiles);
        }
        public void Test9_DeleteDuplicates()
        {
            if (!Directory.Exists(TestRunDirectoryPath))
            {
                Setup();
            }

            IFilesSeeker filesSeeker = new FilesSeeker();
            var          files       = filesSeeker.ByPath(TestRunDirectoryPath);

            files = files.Where(x => !x.Contains(".directory")).ToList();

            GenerateFiles gf       = new GenerateFiles();
            var           allFiles = gf.StringsToModels(files.ToArray());

            var value = new FileModelDeleteDuplicates(new FileHasherMd5()).Run(allFiles);



            Assert.AreEqual(CountOfOriginFiles, value.Count);
        }
Exemplo n.º 4
0
        public List <string> GetFilesByPath(string path, string [] extensions)
        {
            IFilesSeeker filesSeeker = new FilesSeeker();

            return(filesSeeker.ByPathAndExtensions(path, extensions));
        }