public void CanBuildDom() { const string html = "<ul><li>first</li><li>second</li></ul>"; var node = DomElement.ParseDom(html); // Ensure this is the root node. Assert.Null(node.Fragment); Assert.Null(node.Parent); // first child of root is null var ul = Assert.Single(node.Children); Assert.Equal("ul", ul.Fragment.Value); Assert.Equal(2, ul.Children.Count); // first li is text node with "first" var first = ul.Children[0]; Assert.Equal("li", first.Fragment.Value); Assert.Single(first.Children); Assert.Equal("first", first.Children.Single().Fragment.Value); // second li is text node with "second" var second = ul.Children[1]; Assert.Equal("li", second.Fragment.Value); Assert.Single(second.Children); Assert.Equal("second", second.Children.Single().Fragment.Value); }