Beispiel #1
0
        public void sort(String source, bool hasHeader, bool descending, bool caseSensitive, bool unique, String expected)
        {
            String inPath  = Path.Combine(TestUtil.findTestFileLocation(), "csv", source);
            String outPath = Path.Combine(TestUtil.findTestOutputLocation(), "csv", "line_" + expected);

            FileUtil.assureDirectoryStructExists(outPath);

            using (Pnyx p = new Pnyx())
            {
                p.read(inPath);
                if (hasHeader)
                {
                    p.lineFilter(new SkipSpecificFilter(1));
                }
                p.sort(descending, caseSensitive, unique, tempDirectory: Path.Combine(TestUtil.findTestOutputLocation(), "csv"));
                p.write(outPath);
                p.process();
            }

            String expectedPath = Path.Combine(TestUtil.findTestFileLocation(), "csv", expected);

            Assert.Null(TestUtil.binaryDiff(expectedPath, outPath));
        }