Beispiel #1
0
        public void InnerText_set_will_throw_if_no_root_element()
        {
            var doc = new DomDocument();

            doc.AppendComment("comment");
            Assert.Throws <InvalidOperationException>(() => doc.InnerText = "world");
        }
Beispiel #2
0
        public void IsDocumentElement_should_be_true_for_root()
        {
            DomDocument doc = new DomDocument();

            doc.AppendComment("c");
            var e = doc.AppendElement("t");

            Assert.True(e.IsDocumentElement);
        }
Beispiel #3
0
        public void Elements_should_be_empty_in_document_with_no_document_element()
        {
            DomDocument doc = new DomDocument();

            Assert.Empty(doc.Elements);

            doc.AppendComment("text");
            Assert.Empty(doc.Elements);
        }