Example #1
0
        public void InsertBeforeWithInvalidXPath()
        {
            const string Pre = "<root><first /><last /></root>";
            const string XPath = "root";
            var task = new AddFragment {Fragment = Fragment, Before = InvalidXPath};

            Assert.Throws<TaskExecutionException>(() => Run(Pre, null, XPath, task));
        }
Example #2
0
 public void InsertAfterWithXPathSelectingAnAttribute()
 {
     const string Pre = "<root attribute=\"\"><first /><last /></root>";
     const string Post = "<root attribute=\"\"><first /><last />" + Fragment + "</root>";
     const string XPath = "root";
     var task = new AddFragment {Fragment = Fragment, After = "@attribute"};
     Run(Pre, Post, XPath, task);
 }
Example #3
0
 public void AddFragmentBefore()
 {
     const string Pre = "<root><first /><last /></root>";
     const string Post = "<root>" + Fragment + "<first /><last /></root>";
     const string XPath = "root";
     var task = new AddFragment {Fragment = Fragment, Before = "first"};
     Run(Pre, Post, XPath, task);
 }
Example #4
0
 public void InsertAfterWithNonSelectingXPath()
 {
     const string Pre = "<root><first /><last /></root>";
     const string Post = "<root><first /><last />" + Fragment + "</root>";
     const string XPath = "root";
     var task = new AddFragment {Fragment = Fragment, After = "non-existing"};
     Run(Pre, Post, XPath, task);
 }
Example #5
0
 public void AddFragmentAtDefaultPosition()
 {
     const string Pre = "<root />";
     const string Post = "<root>" + Fragment + "</root>";
     const string XPath = "root";
     var task = new AddFragment {Fragment = Fragment};
     Run(Pre, Post, XPath, task);
 }