public void InnerText_set_will_throw_if_no_root_element() { var doc = new DomDocument(); doc.AppendComment("comment"); Assert.Throws <InvalidOperationException>(() => doc.InnerText = "world"); }
public void IsDocumentElement_should_be_true_for_root() { DomDocument doc = new DomDocument(); doc.AppendComment("c"); var e = doc.AppendElement("t"); Assert.True(e.IsDocumentElement); }
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); }