Exemplo n.º 1
0
        public void When_ChangeNodeText_Method_call_it_should_not_return_null()
        {
            ChangeTheTextOfResultXml changeTheTextOfResultXml = new ChangeTheTextOfResultXml();
            XDocument resultXDoc = 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>");

            Assert.AreNotEqual(null, changeTheTextOfResultXml.ChangeNodeText(diffXDoc, resultXDoc).ToString());
        }
Exemplo n.º 2
0
        public void When_ChangeNodeText_Method_call_it_should_change_text_of_node()
        {
            ChangeTheTextOfResultXml changeTheTextOfResultXml = new ChangeTheTextOfResultXml();
            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\"><textchanged><del>Another text</del><ins>Changed text</ins></textchanged><fob /></d><x firstAttr=\"changed attribute value\" secondAttr=\"value2\" cs_crestid=\"5\" oldattr_firstAttr=\"value1\" /><y><!--Any comments?--><z id=\"10\">Just another text</z></y></b>");
            XDocument resultXDoc     = 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>");

            Assert.AreEqual(expectedResult.ToString(), changeTheTextOfResultXml.ChangeNodeText(diffXDoc, resultXDoc).ToString());
        }