示例#1
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>());
            }
示例#2
0
 public void ShouldCheckTheExistingTypeExists()
 {
     Assert.That(
         () => KmlFactory.Replace <NotRegisteredElement, ReplacedElement>(),
         Throws.TypeOf <ArgumentException>());
 }