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