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