Exemplo n.º 1
0
 public static void AssertXmlElement(string xpath, XmlElement expectedRoot, XmlElement actualRoot)
 {
     var elemExpected = (XmlElement) expectedRoot.SelectSingleNode(xpath);
     var elemActual = (XmlElement) actualRoot.SelectSingleNode(xpath);
     var checker = new ElementChecker(elemExpected);
     checker.Check(elemActual);
 }
        public static void AssertXmlElement(string xpath, XmlElement expectedRoot, XmlElement actualRoot)
        {
            var elemExpected = (XmlElement)expectedRoot.SelectSingleNode(xpath);
            var elemActual   = (XmlElement)actualRoot.SelectSingleNode(xpath);
            var checker      = new ElementChecker(elemExpected);

            checker.Check(elemActual);
        }
        public void MakeSubstitutionsInXmlNode()
        {
            var memento = new MemoryInstanceMemento("", "");
            memento.SetProperty("color", "blue");
            memento.SetProperty("name", "ObiWan");
            memento.SetProperty("state", "New York");
            memento.SetProperty("direction", "North");

            XmlNode templateNode = _document.DocumentElement.FirstChild;
            var templater = new XmlTemplater(templateNode);

            XmlNode expectedNode = _document.DocumentElement.LastChild;
            var checker = new ElementChecker((XmlElement) expectedNode);

            var actualElement = (XmlElement) templater.SubstituteTemplates(templateNode, memento);

            Assert.IsFalse(ReferenceEquals(templateNode, actualElement));
            checker.Check(actualElement);
        }
Exemplo n.º 4
0
 public void AddChildNode(ElementChecker checker)
 {
     _childNodes.Add(checker);
 }
 public void AddChildNode(ElementChecker checker)
 {
     _childNodes.Add(checker);
 }