Exemplo n.º 1
0
        public void TestLegacyKml()
        {
            const string Xml =
                "<kml xmlns=\"http://earth.google.com/kml/2.2\">" +
                "<Placemark>" +
                "<name>My Placemark</name>" +
                "</Placemark>" +
                "</kml>";

            var parser = new Parser();

            parser.ParseString(Xml, false);

            Kml root = parser.Root as Kml;

            Assert.That(root, Is.Not.Null);

            // Make sure it didn't add the old namespace
            Assert.That(root.GetNamespaces(), Has.No.ContainKey(string.Empty));

            // Make sure it serializes
            Serializer serializer = new Serializer();

            Assert.That(() => serializer.Serialize(root), Throws.Nothing);
            Assert.That(serializer.Xml, Is.Not.Null.Or.Empty);
        }