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);
        }
        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);
        }
 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();
 }
 public static void WriteXml(object o, int depth, XmlWriter log, params string[] exclusions)
 {
     IDumperWriterStrategy strategy = new XmlWriterStrategy(depth, exclusions, log);
     strategy.Write(o);
 }
        public void TestXmlWriterWithListOfList() {
            long result;

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

            Assert.AreEqual(370, result);
        }