Exemplo n.º 1
0
        public void GetGeneSection()
        {
            var readStream  = new BlockGZipStream(ResourceUtilities.GetReadStream(Resources.TopPath("Clinvar20150901.json.gz")), CompressionMode.Decompress);
            var indexStream = ResourceUtilities.GetReadStream(Resources.TopPath("Clinvar20150901.json.gz.jsi"));

            var outStream = new MemoryStream();

            using (var writer = new StreamWriter(outStream, Encoding.UTF8, 512, true))
                using (var qp = new QueryProcessor(new StreamReader(readStream), indexStream, writer))
                {
                    writer.NewLine = "\r\n";
                    qp.PrintSection("genes");
                }

            Assert.NotEqual(0, outStream.Length);
            outStream.Position = 0;
            using (var reader = new StreamReader(outStream))
            {
                var count = 0;
                var line  = reader.ReadLine();
                while (line != null)
                {
                    count++;
                    line = reader.ReadLine();
                }

                Assert.Equal(127, count);
            }
        }