Beispiel #1
0
        public void ElementWithOneAttributeAndNoChildren()
        {
            HTMLBuilder builder = new HTMLBuilder();

            builder.Element("a", a =>
            {
                a.Attribute("b", "c");
            });
            AssertEx.EqualLines("<a b=\"c\"/>", builder);
        }
Beispiel #2
0
        public void ElementWithNoAttributesAndOneChildText()
        {
            HTMLBuilder builder = new HTMLBuilder();

            builder.Element("a", a =>
            {
                a.Text("b");
            });
            AssertEx.EqualLines("<a>b</a>", builder);
        }
Beispiel #3
0
        public void ElementWithNoAttributesAndOneChildElement()
        {
            HTMLBuilder builder = new HTMLBuilder();

            builder.Element("a", a =>
            {
                a.ChildElement("b");
            });
            AssertEx.EqualLines(new[]
            {
                "<a>",
                "  <b/>",
                "</a>"
            },
                                builder);
        }