Пример #1
0
        public void TestUnwrapElement()
        {
            var n1   = new HElement("span", "Content");
            var root = new HElement("div", new HElement("strong", new HElement("em", n1)));

            Assert.Equal("<div><strong><em><span>Content</span></em></strong></div>", root.ToString());

            Assert.Same(n1, n1.Unwrap());
            Assert.Equal("<div><strong><span>Content</span></strong></div>", root.ToString());

            n1 = null;
            Assert.Null(n1.Unwrap());
        }