Ejemplo n.º 1
0
        public void TestExpandEntities()
        {
            using (var stream = SampleData.CreateStream("Engine.Data.Entities.kml"))
            {
                KmlFile file = KmlFile.Load(stream);
                Document document = file.Root as Document;
                Assert.That(document, Is.Not.Null);

                Placemark placemark = document.Features.ElementAt(0) as Placemark;
                EntityMapper mapper = new EntityMapper(file);
                mapper.ParseEntityFields(placemark);

                // Verify that CreateExpandedEntities handles various kinds of
                // entity references, spacing, multiple references.
                foreach (var replacement in Replacements)
                {
                    Assert.That(mapper.ExpandEntities(replacement.Item1), Is.EqualTo(replacement.Item2));
                }
            }
        }