public void TestElementWithChildren()
        {
            var stringBuilder = new StringBuilder();

            using (var textWriter = new StringWriter(stringBuilder))
            {
                var context = MockViewContext(textWriter);
                using (BootstrapElement element = new BootstrapElement(context))
                {
                    element.ClassName = "outer";
                    element.Text      = "I am a parent";
                    element.Add(new BootstrapElement(context)
                    {
                        ClassName = "inner", Text = "I am a child"
                    });
                    element.Add(new BootstrapElement(context)
                    {
                        ClassName = "inner2", Text = "I am another child"
                    });
                    element.ToMvcHtmlString();
                }
            }

            Assert.AreEqual(
                "<div class=\"outer\">" +
                "I am a parent" +
                "<div class=\"inner\">I am a child</div>" +
                "<div class=\"inner2\">I am another child</div>" +
                "</div>",
                stringBuilder.ToString());
        }
        public void TestEmptyElement()
        {
            var stringBuilder = new StringBuilder();

            using (var textWriter = new StringWriter(stringBuilder))
            {
                using (BootstrapElement element = new BootstrapElement(MockViewContext(textWriter)))
                {
                    element.ToMvcHtmlString();
                }
            }

            Assert.AreEqual("<div></div>", stringBuilder.ToString());
        }
        public void TestElementWithText()
        {
            var stringBuilder = new StringBuilder();

            using (var textWriter = new StringWriter(stringBuilder))
            {
                using (BootstrapElement element = new BootstrapElement(MockViewContext(textWriter)))
                {
                    element.TagName   = "h1";
                    element.ClassName = "text-center";
                    element.Text      = "This is a test";
                    element.ToMvcHtmlString();
                }
            }

            Assert.AreEqual("<h1 class=\"text-center\">This is a test</h1>", stringBuilder.ToString());
        }