Example #1
0
File: SetFixture.cs Project: rh/mix
 public void ElementWithoutChildNodes()
 {
     const string pre = @"<root></root>";
     const string post = @"<root>post</root>";
     const string xpath = "root";
     var task = new Set {Value = "post"};
     Run(pre, post, xpath, task);
 }
Example #2
0
File: SetFixture.cs Project: rh/mix
 public void CDataSections()
 {
     const string pre = @"<root><![CDATA[text]]></root>";
     const string post = @"<root><![CDATA[value]]></root>";
     const string xpath = "//text()";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #3
0
File: SetFixture.cs Project: rh/mix
 public void Comments()
 {
     const string pre = @"<root><!--COMMENT--><!--COMMENT--></root>";
     const string post = @"<root><!--value--><!--value--></root>";
     const string xpath = "//comment()";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #4
0
File: SetFixture.cs Project: rh/mix
 public void Attribute()
 {
     const string pre = @"<root attribute=""""></root>";
     const string post = @"<root attribute=""value""></root>";
     const string xpath = "root/@attribute";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #5
0
File: SetFixture.cs Project: rh/mix
 public void Attributes()
 {
     const string pre = @"<root a="""" b="""" c=""""></root>";
     const string post = @"<root a=""value"" b=""value"" c=""value""></root>";
     const string xpath = "//@*";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #6
0
 public void ExecuteWithFileSet()
 {
     Task task = new Set();
     var command = new TaskCommand(task);
     // This will not actually select a file
     command.Context["file"] = "file";
     Assert.IsTrue(command.Execute() == 0);
 }
Example #7
0
 public void ExecuteWithFileNotProperlySet()
 {
     Task task = new Set();
     var command = new TaskCommand(task);
     command.Context["file"] = null;
     // Not selecting any file is not considered an error
     Assert.IsTrue(command.Execute() == 0);
 }
Example #8
0
File: SetFixture.cs Project: rh/mix
 public void ProcessingInstructions()
 {
     const string pre = @"<root><?foo bar?><?foo bar?></root>";
     const string post = @"<root><?foo value?><?foo value?></root>";
     const string xpath = "//processing-instruction()";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #9
0
File: SetFixture.cs Project: rh/mix
 public void NormalText()
 {
     const string pre = @"<root></root>";
     const string post = @"<root>post</root>";
     const string xpath = "root";
     var task = new Set {Value = "post"};
     Run(pre, post, xpath, task);
 }
Example #10
0
File: SetFixture.cs Project: rh/mix
 public void TextNodes()
 {
     const string pre = @"<root>text</root>";
     const string post = @"<root>value</root>";
     const string xpath = "//text()";
     var task = new Set {Value = "value"};
     Run(pre, post, xpath, task);
 }
Example #11
0
File: SetFixture.cs Project: rh/mix
 public void SpecialText()
 {
     const string pre = @"<root></root>";
     const string post = @"<root>&gt;</root>";
     const string xpath = "root";
     var task = new Set {Value = ">"};
     Run(pre, post, xpath, task);
 }
Example #12
0
 public void Task()
 {
     Task task = new Set();
     var command = new TaskCommand(task);
     Assert.AreEqual(task, command.Task);
 }
Example #13
0
 public void Execute()
 {
     Task task = new Set();
     var command = new TaskCommand(task);
     Assert.IsTrue(command.Execute() == 0);
 }
Example #14
0
 public void CommandToString()
 {
     Task task = new Set();
     var command = new TaskCommand(task);
     Assert.AreEqual("set", command.ToString());
 }