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"]); }
public void AddCssClassTest() { ElementAttributesDictionary target = new ElementAttributesDictionary(); target.AddCssClass(null); Assert.IsFalse(target.ContainsKey("class")); target.AddCssClass(string.Empty); Assert.IsFalse(target.ContainsKey("class")); target.AddCssClass("class1"); Assert.IsTrue(target.ContainsKey("class")); Assert.AreEqual("class1", target["class"]); target.AddCssClass("class2"); Assert.AreEqual("class1 class2", target["class"]); target.AddCssClass("class1"); Assert.AreEqual("class1 class2", target["class"]); target.AddCssClass("class2"); Assert.AreEqual("class1 class2", target["class"]); }