Пример #1
0
        public void when_visiting_xml_then_adds_members()
        {
            var member  = DocReader.Read(Path.ChangeExtension(typeof(ProviderType).Assembly.Location, ".xml"));
            var visitor = new XmlVisitor();

            member.Accept(visitor);

            Assert.Equal("doc", visitor.Xml.Root.Name);
            Assert.Equal("members", visitor.Xml.Root.Elements().First().Name);

            //WriteXml(visitor.Xml);
        }
Пример #2
0
        public void when_writing_xml_then_can_roundtrip()
        {
            var originalXml = XDocument.Load(Path.ChangeExtension(typeof(ProviderType).Assembly.Location, ".xml"));
            var member      = DocReader.Read(typeof(ProviderType).Assembly);
            var visitor     = new XmlVisitor();

            member.Accept(visitor);

            //WriteXml(originalXml.Normalize(), "C:\\Temp\\source.xml");
            //WriteXml(visitor.Xml.Normalize(), "C:\\Temp\\target.xml");

            //Assert.True(originalXml.NormalizedEquals(visitor.Xml));
        }
Пример #3
0
        public void when_visiting_xml_then_adds_source_assembly()
        {
            var member  = DocReader.Read(typeof(ProviderType).Assembly);
            var visitor = new XmlVisitor();

            member.Accept(visitor);

            Assert.Equal("doc", visitor.Xml.Root.Name);
            Assert.Equal("assembly", visitor.Xml.Root.Elements().First().Name);
            Assert.Equal(typeof(ProviderType).Assembly.GetName().Name, visitor.Xml.Root.Elements().First().Elements().First().Value);

            //WriteXml(visitor.Xml);
        }