示例#1
0
        public static void WriteXml(object o, int depth, IEnumerable <string> exclusions, XmlWriter log)
        {
            IDumperWriterStrategy strategy = new XmlWriterStrategy(depth, exclusions, log);

            strategy.Write(o);
            log.Flush();
        }
示例#2
0
        public void TestXmlWriterConstructor()
        {
            var       builder   = new StringBuilder();
            XmlWriter xmlWriter = XmlWriter.Create(builder);
            var       strategy  = new XmlWriterStrategy(xmlWriter);

            strategy.Write(One);
            xmlWriter.Flush();
            int result = builder.Length;

            Assert.AreEqual(368, result);
        }
示例#3
0
        public void TestXmlWriterConstructorWithDepth()
        {
            long result;

            using (var stream = new MemoryStream()) {
                XmlWriter xmlWriter = XmlWriter.Create(stream);
                var       strategy  = new XmlWriterStrategy(1, null, xmlWriter);
                strategy.Write(Two);
                xmlWriter.Flush();
                result = stream.Length;
            }

            Assert.AreEqual(475, result);
        }
示例#4
0
        public void TestXmlWriterWithListOfListWithDepth()
        {
            long result;

            using (var stream = new MemoryStream()) {
                XmlWriter xmlWriter = XmlWriter.Create(stream);
                var       strategy  = new XmlWriterStrategy(2, null, xmlWriter);
                strategy.Write(Three);
                xmlWriter.Flush();
                result = stream.Length;
            }

            Assert.AreEqual(632, result);
        }
示例#5
0
        public static void WriteXml(object o, int depth, XmlWriter log, params string[] exclusions)
        {
            IDumperWriterStrategy strategy = new XmlWriterStrategy(depth, exclusions, log);

            strategy.Write(o);
        }