示例#1
0
 public void CanParseCloseTag()
 {
     "<p></p>".AssertParsesTo(
         Fragment.OpenTag("p", false),
         Fragment.CloseTag("p")
         );
 }
        public void IsClosedReturnsCloseTags()
        {
            var t = Fragment.CloseTag("a");

            Assert.True(t.IsClose("a"));
            Assert.False(t.IsClose("b"));
            Assert.True(t.IsClose());
        }
示例#3
0
 public void CanParseScriptTagWithHtml()
 {
     "<script type=\"text/javascript\">document.write('<p>Test</p>');</script>".AssertParsesTo(
         Fragment.OpenTag("script", false, HtmlAttribute.Create("type", "text/javascript")),
         Fragment.Text("document.write('<p>Test</p>');"),
         Fragment.CloseTag("script")
         );
 }
示例#4
0
 public void CanParseInnerText()
 {
     "<p> Testing </p>".AssertParsesTo(
         Fragment.OpenTag("p", false),
         Fragment.Text(" Testing "),
         Fragment.CloseTag("p")
         );
 }
示例#5
0
 public void CanParseInvalidDOM()
 {
     "<p>test <bold>tada</p>".AssertParsesTo(
         Fragment.OpenTag("p", false),
         Fragment.Text("test "),
         Fragment.OpenTag("bold", false),
         Fragment.Text("tada"),
         Fragment.CloseTag("p")
         );
 }
示例#6
0
 public void CanParseInvalidHtml()
 {
     "<p>I <3 html!</p>".AssertParsesTo(
         Fragment.OpenTag("p", false),
         Fragment.Text("I "),
         Fragment.Text("<"),
         Fragment.Text("3 stuff!"),
         Fragment.CloseTag("p")
         );
 }