示例#1
0
 public void InsertBeforeWithNonSelectingInvalidXPath()
 {
     const string Pre = @"<root first="""" />";
     const string Post = @"<root first="""" post=""foo"" />";
     const string XPath = "root";
     var task = new AddAttribute {Name = "post", Value = "foo", Before = "@non-existing"};
     Run(Pre, Post, XPath, task);
 }
示例#2
0
 public void InsertBefore()
 {
     const string Pre = @"<root first="""" />";
     const string Post = @"<root post=""foo"" first="""" />";
     const string XPath = "root";
     var task = new AddAttribute {Name = "post", Value = "foo", Before = "@first"};
     Run(Pre, Post, XPath, task);
 }
示例#3
0
        public void InsertBeforeWithInvalidXPath()
        {
            const string Pre = @"<root first="""" />";
            const string XPath = "root";
            var task = new AddAttribute {Name = "post", Value = "foo", Before = "///"};

            Assert.Throws<TaskExecutionException>(() => Run(Pre, null, XPath, task));
        }
示例#4
0
 public void AttributeExists()
 {
     const string Pre = @"<root name="""" />";
     const string Post = Pre;
     const string XPath = "root";
     var task = new AddAttribute {Name = "name"};
     Run(Pre, Post, XPath, task);
 }
示例#5
0
 public void SetNameOnly()
 {
     const string Pre = @"<root />";
     const string Post = @"<root post="""" />";
     const string XPath = "root";
     var task = new AddAttribute {Name = "post"};
     Run(Pre, Post, XPath, task);
 }