示例#1
0
            public void ShouldCreateAnInstanceOfTheSpecifiedType()
            {
                Element element = KmlFactory.CreateElement(new XmlComponent(null, "test", ""));

                Assert.That(element, Is.Not.Null);
                Assert.That(element, Is.InstanceOf <ManuallyRegisteredElement>());
            }
示例#2
0
        public void TestCreation()
        {
            Element element = KmlFactory.CreateElement(new XmlComponent(null, "test", string.Empty));

            Assert.That(element, Is.Not.Null);
            Assert.That(element, Is.InstanceOf <TestElementClass1>());
        }
示例#3
0
            public void ShouldReplaceTheSpecifiedType()
            {
                var component = new XmlComponent(null, "existing", "");

                KmlFactory.Register <ExistingElement>(component);

                KmlFactory.Replace <ExistingElement, ReplacedElement>();
                Element result = KmlFactory.CreateElement(component);

                Assert.That(result, Is.InstanceOf <ReplacedElement>());
            }