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

            builder.AddElement("div", new HTMLAttribute[] { new HTMLAttribute("class", "parent") });
            builder.Child(() =>
            {
                builder.AddElement("div", "Child Level 1");
                builder.AddAttribute("class", "child");
                builder.Child(() =>
                {
                    builder.H(2, "Child Level 2");
                });
            });
            Debug.WriteLine(builder.ToString());
        }
Esempio n. 2
0
        public void DeeplyNested()
        {
            var builder = new HTMLBuilder();

            for (int i = 1; i <= 25; i++)
            {
                builder.Child().Div(className: "class" + i.ToString(), id: "element" + i.ToString());
            }

            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertEqualDeeplyNested), builder.ToString());
        }