Esempio n. 1
0
        public void SingleLineComment()
        {
            var builder = new HTMLBuilder();

            builder.Document("en").Body().Comment("A comment for a div element").Div(content: "HTML comments test");
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertEqualSingleLineComment), builder.ToString());
        }
Esempio n. 2
0
        public void HelloWorld()
        {
            var builder = new HTMLBuilder();

            builder.Document().Body(content: "Hello world!");
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertEqualHelloWorld), builder.ToString());
        }
Esempio n. 3
0
        public void TabSize8()
        {
            var builder = new HTMLBuilder();

            builder.Document().Body(content: "Size 8");
            builder.Settings.TabSize = 8;
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertEqualTabSize8), builder.ToString());
        }
Esempio n. 4
0
        public void LargeHTMLDocument()
        {
            var builder = new HTMLBuilder();

            builder.Settings.EnforceProperNesting = false;
            builder.Document().Body().P().Child().AddElement("div");
            for (int i = 1; i <= 1000; i++)
            {
                builder.AddElement("p", "List element " + i.ToString()).Child();
            }
            Assert.AreEqual(builder.ToString().Split('\n').Length, 3007);
        }
Esempio n. 5
0
        public void CreateAComponent()
        {
            var builder = new HTMLBuilder();

            builder.Document().Body()
            .H(1, "Component example")
            .BeginComponent("My Component")
            .Div("component")
            .Child()
            .AddElement("span", "Extra component content")
            .Parent()
            .EndComponent();
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertCreateComponent), builder.ToString());
        }