Exemple #1
0
        public void RemoveElementAll()
        {
            var xpath       = (string)this.TestContext.DataRow["xpath"];
            var xml         = (string)this.TestContext.DataRow["xml"];
            var document    = XDocument.Parse(xml);
            var countBefore = document.XPathSelectElements(xpath).Count();
            var transformer = new RemoveElementTransformer(xpath, true);

            transformer.Transform(document);
            Assert.AreEqual(0, document.XPathSelectElements(xpath).Count());
        }
Exemple #2
0
        public void RemoveElementFirst()
        {
            var xpath       = (string)this.TestContext.DataRow["xpath"];
            var xml         = (string)this.TestContext.DataRow["xml"];
            var document    = XDocument.Parse(xml);
            var countBefore = document.XPathSelectElements(xpath).Count();
            var transformer = new RemoveElementTransformer(xpath, false);

            transformer.Transform(document);
            var countAfterExpected = (countBefore > 0) ? --countBefore : countBefore;

            Assert.AreEqual(countAfterExpected, document.XPathSelectElements(xpath).Count());
        }
 public void RemoveElementFirst()
 {
     var xpath = (string)this.TestContext.DataRow["xpath"];
     var xml = (string)this.TestContext.DataRow["xml"];
     var document = XDocument.Parse(xml);
     var countBefore = document.XPathSelectElements(xpath).Count();
     var transformer = new RemoveElementTransformer(xpath, false);
     transformer.Transform(document);
     var countAfterExpected = (countBefore > 0) ? --countBefore : countBefore;
     Assert.AreEqual(countAfterExpected, document.XPathSelectElements(xpath).Count());
 }
 public void RemoveElementAll()
 {
     var xpath = (string)this.TestContext.DataRow["xpath"];
     var xml = (string)this.TestContext.DataRow["xml"];
     var document = XDocument.Parse(xml);
     var countBefore = document.XPathSelectElements(xpath).Count();
     var transformer = new RemoveElementTransformer(xpath, true);
     transformer.Transform(document);
     Assert.AreEqual(0, document.XPathSelectElements(xpath).Count());
 }