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); }
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); }
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)); }
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); }
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); }