Ejemplo n.º 1
0
        public void Test_GenericElement_And_Element_Clear()
        {
            GenericElement<Element> t = new GenericElement<Element>("Test");

            t.Id("myId");
            t.Attributes(new { data_test = true, data_test2 = "true" });

            // Render again to register options above
            t.Render();
            t.Clear();

            Assert.AreEqual("<Test></Test>", t.Render(), "Options not removed");
        }
Ejemplo n.º 2
0
        public void Test_GenericElement_Render_With_Id_And_Css()
        {
            GenericElement<Element> t = new GenericElement<Element>("Test");

            t.Id("myId");
            t.AddCss("myClass");
            Assert.AreEqual("<Test class=\"myClass\" id=\"myId\"></Test>", t.Render(),
                "Class is not the same");
        }
Ejemplo n.º 3
0
        public void Test_GenericElement_With_Id_Render()
        {
            GenericElement<Element> t = new GenericElement<Element>("Test");

            t.Id("myId");
            Assert.AreEqual("<Test id=\"myId\"></Test>", t.Render(), "Id is not the same");
        }
Ejemplo n.º 4
0
        public void Test_GenericElement_Render_With_HtmlAttributes()
        {
            GenericElement<Element> t = new GenericElement<Element>("Test");

            t.Attributes(new { data_test = true, data_test2 = "true" });
            Assert.AreEqual("<Test data-test=\"True\" data-test2=\"true\"></Test>", t.Render(),
                "Attributes is not the same");
        }