Example #1
0
        public void AddInnerHtml()
        {
            var list = new Tag[] { new TestTag("asd"), new TestTag("qwe"), new TestTag("div") };

            Assert.That(_tag.Content.Count, Is.EqualTo(0));
            _tag.AddInnerHtml(list);
            Assert.That(_tag.Content.SequenceEqual(list));
        }
Example #2
0
        public void Render()
        {
            RenderAssertion(new TestTag("tagname"), "<tagname></tagname>");
            RenderAssertion(new TestTag("tagname", TagRenderMode.SelfClosing), "<tagname>");

            var tag = new TestTag("tagname");

            tag.AddAttribute("attr1");
            tag.AddAttribute("attr2", "value of attr");
            RenderAssertion(tag, "<tagname attr1 attr2=\"value of attr\"></tagname>");

            tag = new TestTag("tagname");
            tag.AddAttribute("attr1");
            tag.AddInnerHtml(new TestTag("innerTag", TagRenderMode.SelfClosing));
            RenderAssertion(tag, "<tagname attr1><innerTag></tagname>");
        }