Beispiel #1
0
        public void TestCaseInsensitiveAttributes()
        {
            string            value = "small";
            BaseGadgetControl item  = new GadgetLiteral();

            item.SetAttribute("Big", value);
            Assert.AreEqual(value, item.GetAttribute("big"));

            string newval = "newval";

            item.SetAttribute("big", newval);
            Assert.AreEqual(newval, item.GetAttribute("big"));
        }
Beispiel #2
0
        public void TestSingleAttributes(string name, string value)
        {
            BaseGadgetControl item = new GadgetLiteral();

            item.SetAttribute(name, value);
            Assert.AreEqual(value, item.GetAttribute(name));
        }
Beispiel #3
0
        public void TestManyAttributes()
        {
            string            valueBase = "small_{0}";
            string            keyBase   = "foo{0}";
            BaseGadgetControl item      = new GadgetLiteral();

            int max = 200;

            for (int i = 0; i < max; i++)
            {
                item.SetAttribute(string.Format(keyBase, i), string.Format(valueBase, i));
            }

            int[] keys = new int[] { 0, 5, 55, 99, 121 };
            for (int i = 0; i < keys.Length; i++)
            {
                Assert.AreEqual(string.Format(valueBase, i), item.GetAttribute(string.Format(keyBase, i)));
            }

            Assert.AreEqual(string.Empty, item.GetAttribute("DOESNOTEXIST"));
        }