Exemplo n.º 1
0
 public void InsertAsFirstChild()
 {
     const string pre = @"<root foo=""bar""><bar>baz</bar></root>";
     const string post = @"<root><foo>bar</foo><bar>baz</bar></root>";
     const string xpath = "//@foo";
     var task = new ConvertToElement();
     Run(pre, post, xpath, task);
 }
Exemplo n.º 2
0
        public void NameShouldBeSuppliedForCData()
        {
            const string pre = @"<root><![CDATA[text]]></root>";
            const string xpath = "//text()";
            var task = new ConvertToElement();

            Assert.Throws<RequirementException>(() => Run(pre, null, xpath, task));
        }
Exemplo n.º 3
0
 public void CommentsAtRootShouldNotBeConverted()
 {
     const string pre = @"<!--comment--><root></root>";
     const string post = pre;
     const string xpath = "//comment()";
     var task = new ConvertToElement {Name = "converted"};
     Run(pre, post, xpath, task);
 }
Exemplo n.º 4
0
 public void ElementNotYetPresent()
 {
     const string pre = @"<root foo=""bar"" />";
     const string post = @"<root><foo>bar</foo></root>";
     const string xpath = "//@foo";
     var task = new ConvertToElement();
     Run(pre, post, xpath, task);
 }
Exemplo n.º 5
0
 public void Comment()
 {
     const string pre = @"<root><!--comment--></root>";
     const string post = @"<root><converted>comment</converted></root>";
     const string xpath = "//comment()";
     var task = new ConvertToElement {Name = "converted"};
     Run(pre, post, xpath, task);
 }
Exemplo n.º 6
0
 public void CData()
 {
     const string pre = @"<root><![CDATA[text]]></root>";
     const string post = @"<root><foo>text</foo></root>";
     const string xpath = "//text()";
     var task = new ConvertToElement {Name = "foo"};
     Run(pre, post, xpath, task);
 }
Exemplo n.º 7
0
 public void Text()
 {
     const string pre = @"<root>foo</root>";
     const string post = @"<root><foo>foo</foo></root>";
     const string xpath = "//text()";
     var task = new ConvertToElement {Name = "foo"};
     Run(pre, post, xpath, task);
 }
Exemplo n.º 8
0
 public void ProcessingInstructionsAtRootShouldNotBeConverted()
 {
     const string pre = @"<?pi foo?><root></root>";
     const string post = pre;
     const string xpath = "//processing-instruction()";
     var task = new ConvertToElement();
     Run(pre, post, xpath, task);
 }
Exemplo n.º 9
0
 public void ProcessingInstruction()
 {
     const string pre = @"<root><?pi foo?></root>";
     const string post = @"<root><pi>foo</pi></root>";
     const string xpath = "//processing-instruction()";
     var task = new ConvertToElement();
     Run(pre, post, xpath, task);
 }