Ejemplo n.º 1
0
        public void When_ChangeAttrNode_Method_call_it_should_not_return_null()
        {
            ChangeAttributeOfNode changeAttributeOfNode = new ChangeAttributeOfNode();
            XDocument             resultXDoc            = XDocument.Parse("<b cs_crestid=\"1\"><a>Some text 1</a><b>Some text 2</b><c cs_crestid=\"3\">Some text 3</c><d cs_crestid=\"4\">Another text<fob /></d><x firstAttr=\"value1\" secondAttr=\"value2\" cs_crestid=\"5\" /><y><!--Any comments?--><z id=\"10\">Just another text</z></y></b>");

            Assert.AreNotEqual(null, changeAttributeOfNode.ChangeAttrNode(diffXDoc, resultXDoc).ToString());
        }
Ejemplo n.º 2
0
        public void When_ChangeAttrNode_Method_call_it_change_attribute_of_node()
        {
            ChangeAttributeOfNode changeAttributeOfNode = new ChangeAttributeOfNode();
            XDocument             expectedResult        = XDocument.Parse("<b cs_crestid=\"1\"><a OldName=\"a\" NewName=\"yy\">Some text 1</a><b>Some text 2</b><c cs_crestid=\"3\">Some text 3</c><d cs_crestid=\"4\">Another text<fob /></d><x firstAttr=\"value1\" secondAttr=\"value2\" cs_crestid=\"5\" /><y><!--Any comments?--><z id=\"10\">Just another text</z></y></b>");
            XDocument             resultXDoc            = XDocument.Parse("<b cs_crestid=\"1\"><a>Some text 1</a><b>Some text 2</b><c cs_crestid=\"3\">Some text 3</c><d cs_crestid=\"4\">Another text<fob /></d><x firstAttr=\"value1\" secondAttr=\"value2\" cs_crestid=\"5\" /><y><!--Any comments?--><z id=\"10\">Just another text</z></y></b>");

            Assert.AreEqual(expectedResult.ToString(), changeAttributeOfNode.ChangeAttrNode(diffXDoc, resultXDoc).ToString());
        }