public void TestFilterGZipOutput()
            {
                const int limit = 100;

                Assert.False(File.Exists(outputFilename));

                TriplesFilterReorderSort.FilterReorderSort(filename, outputFilename, limit);

                Assert.True(File.Exists(outputFilename));
                var lines = SharpZipHandler.ReadGZip(outputFilename);

                Assert.NotNull(lines);
                Assert.NotEmpty(lines);

                //Hardcoded number, Heuristic.
                Assert.Equal(201, lines.Count());
            }
        public void TestFilterCompareWithPlainCount()
        {
            const string filename = "Resources/Filter5k-PlainCount.nt";

            Assert.True(File.Exists(filename));
            var outputFilename = FileHelper.GetFilteredOutputFilename(filename);

            outputFilename.DeleteIfExists();

            Assert.False(File.Exists(outputFilename));

            TriplesFilterReorderSort.FilterReorderSort(filename, outputFilename);

            Assert.True(File.Exists(outputFilename));
            var gZipLines  = SharpZipHandler.ReadGZip(outputFilename);
            var plainLines = FileHelper.ReadLines(filename);

            Assert.Equal(gZipLines.Count(), plainLines.Count());

            outputFilename.DeleteIfExists();
        }
Example #3
0
        public void TestReadLinesCompressedNotExisting()
        {
            const string filename = "Resources/NotExisting.nt.gz";

            Assert.Empty(SharpZipHandler.ReadGZip(filename));
        }