public void ToStringTest()
        {
            ElementAttributesDictionary target = new ElementAttributesDictionary();

            target.Add("Test1", "Test1");
            target.Add("Test2", "Test2");
            Assert.AreEqual(" Test1=\"Test1\" Test2=\"Test2\"", target.ToString());
        }
        public void ElementAttributesDictionaryConstructorTest1()
        {
            ElementAttributesDictionary source = new ElementAttributesDictionary();

            source.Add("Test1", "Test1");
            source.Add("Test2", "Test2");
            ElementAttributesDictionary target = new ElementAttributesDictionary(source);

            Assert.AreEqual <int>(2, target.Count);
            Assert.IsTrue(target.ContainsKey("Test1"));
            Assert.AreEqual("Test1", target["Test1"]);
            Assert.IsTrue(target.ContainsKey("Test2"));
            Assert.AreEqual("Test2", target["Test2"]);
        }
Exemplo n.º 3
0
        public void RenderTest()
        {
            Input  target = CreateInput();
            string name   = "testname";
            ElementAttributesDictionary extraAttributes = new ElementAttributesDictionary();

            extraAttributes.Add("Test1", "Test1");

            Assert.AreEqual("<input type=\"test\" name=\"testname\" value=\"123\" />", target.Render(name, "123"));
            Assert.AreEqual("<input Test1=\"Test1\" type=\"test\" name=\"testname\" value=\"123\" />", target.Render(name, "123", extraAttributes));
        }