コード例 #1
0
ファイル: LoopFilesTests.cs プロジェクト: GitEdvard/FileIt
        public void TestLoopFilesByDir()
        {
            var path  = @"C:\Smajobb\Misc\Test code\ReplaceIsNull\ReplaceIsNull";
            var iter  = new SimpleFileExtractor("*.cs");
            var files = iter.ExtractFiles(path);

            Assert.AreEqual(10, files.Length);
        }
コード例 #2
0
        public override string[] ExtractFiles(string path)
        {
            var sortFileFinder = new SimpleFileExtractor(Constants.FileExecuteOrderFileName);
            var sortFilePath   = sortFileFinder.ExtractFiles(path).
                                 ToList().FirstOrDefault();

            Console.WriteLine(sortFilePath != null ? $"Sort file found ({sortFilePath})" : "No sort file found");
            _sortFileStream = sortFilePath != null ? new FileIOStream(sortFilePath) : null;
            var sorter    = new FileNameSorter(_sortFileStream, Constants.OutputFilename);
            var extractor = new SimpleFileExtractor(DefaultPattern);
            var files     = extractor.ExtractFiles(path);

            return(sorter.SortFiles(files));
        }