Ejemplo n.º 1
0
        public void NodeValue_equals_text()
        {
            DomDocument doc     = new DomDocument();
            var         comment = doc.CreateComment("hello");

            Assert.Equal("hello", comment.NodeValue);
        }
Ejemplo n.º 2
0
        public void NodeName_equals_attribute_name()
        {
            var doc     = new DomDocument();
            var comment = doc.CreateComment("");

            Assert.Equal("#comment", comment.NodeName);
        }
Ejemplo n.º 3
0
 public void test_append_multiple_noncontent_nodes()
 {
     DomDocument doc = new DomDocument();
     var docType = doc.CreateDocumentType("html");
     var ws = doc.CreateComment("time");
     var html = doc.CreateElement("html");
     doc.Append(docType, ws, html);
     Assert.That(doc.DocumentElement, Is.SameAs(html));
     Assert.That(doc.ChildNodes.Count, Is.EqualTo(3));
 }
Ejemplo n.º 4
0
        public void Append_should_append_multiple_noncontent_nodes()
        {
            DomDocument doc     = new DomDocument();
            var         docType = doc.CreateDocumentType("html");
            var         ws      = doc.CreateComment("time");
            var         html    = doc.CreateElement("html");

            doc.Append(docType, ws, html);
            Assert.Same(html, doc.DocumentElement);
            Assert.Equal(3, doc.ChildNodes.Count);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Appends a comment to document root.
        /// </summary>
        ///
        /// <param name="comment">
        /// The comment.
        /// </param>

        override protected void AppendCommentToDocument(String comment)
        {
            Document.AppendChildUnsafe(Document.CreateComment(comment));
        }