Exemple #1
0
        public void NoSugarTonight()
        {
            var textReader = new StringReader(UnsweetenedUpstream.ToUnixEndings());
            var xmlReader  = XmlReader.Create(textReader);
            var meepReader = new XDownstreamReader(xmlReader);

            try
            {
                var doc = new XmlDocument();
                doc.PreserveWhitespace = true;
                doc.Load(meepReader);

                Assert.Equal(UnsweetenedUpstream.ToUnixEndings(), doc.InnerXml);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #2
0
        public void DesweetenUpstream()
        {
            var textReader = new StringReader(SweetenedUpstream.ToUnixEndings());
            var xmlReader  = XmlReader.Create(textReader);
            var meepReader = new XUpstreamReader(xmlReader);

            var doc = new XmlDocument();

            doc.Load(meepReader);

            Assert.NotNull(doc);

            var untextReader = new StringReader(UnsweetenedUpstream.ToUnixEndings());
            var unxmlReader  = XmlReader.Create(untextReader);

            var undoc = new XmlDocument();

            undoc.Load(unxmlReader);

            Assert.Equal(undoc.InnerXml, doc.InnerXml);
        }