Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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));
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }