示例#1
0
        public void TestWrapAll()
        {
            var n1   = new HElement("span", "Content 1");
            var n2   = new HElement("span", "Content 2");
            var n3   = new HElement("span", "Content 3");
            var n4   = new HElement("span", "Content 4");
            var root = new HElement("div", n1, n2, n3, n4);

            var elements = new HElement[] { n1, n3, n4 };

            Assert.Same(elements, elements.WrapAll(new HElement("p", new HElement("a"))));
            Assert.Equal("<div><p><a><span>Content 1</span><span>Content 3</span><span>Content 4</span></a></p><span>Content 2</span></div>", root.ToString());
        }