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

            Assert.Throws<RequirementException>(() => Run(pre, null, xpath, task));
        }
Ejemplo n.º 3
0
 public void CommentShouldNotBeConvertedWhenTheNamedAttributeAlreadyExists()
 {
     const string pre = @"<root foo=""""><!--text--></root>";
     const string post = pre;
     const string xpath = "//comment()";
     var task = new ConvertToAttribute {Name = "foo"};
     Run(pre, post, xpath, task);
 }
Ejemplo n.º 4
0
 public void Comment()
 {
     const string pre = @"<root><!--text--></root>";
     const string post = @"<root foo=""text""></root>";
     const string xpath = "//comment()";
     var task = new ConvertToAttribute {Name = "foo"};
     Run(pre, post, xpath, task);
 }
Ejemplo n.º 5
0
 public void CData()
 {
     const string pre = @"<root><![CDATA[text]]></root>";
     const string post = @"<root foo=""text""></root>";
     const string xpath = "//text()";
     var task = new ConvertToAttribute {Name = "foo"};
     Run(pre, post, xpath, task);
 }
Ejemplo n.º 6
0
 public void ProcessingInstructionShouldNotBeConvertedWhenTheNamedAttributeAlreadyExists()
 {
     const string pre = @"<root pi=""""><?pi text?></root>";
     const string post = pre;
     const string xpath = "//processing-instruction()";
     var task = new ConvertToAttribute();
     Run(pre, post, xpath, task);
 }
Ejemplo n.º 7
0
 public void ProcessingInstruction()
 {
     const string pre = @"<root><?pi text?></root>";
     const string post = @"<root pi=""text""></root>";
     const string xpath = "//processing-instruction()";
     var task = new ConvertToAttribute();
     Run(pre, post, xpath, task);
 }