Exemple #1
0
 public void DOMStringMapHasAttributesButRequestedMissing()
 {
     var div = new HTMLDivElement();
     div.SetAttribute("data-some", "test");
     div.SetAttribute("data-another", "");
     div.SetAttribute("data-test", "third attribute");
     Assert.IsFalse(div.Dataset.HasDataAttr("user"));
 }
Exemple #2
0
 public void DOMStringMapBindingGet()
 {
     var value = "SomeUser";
     var div = new HTMLDivElement();
     div.SetAttribute("data-user", value);
     Assert.AreEqual(div.Dataset["user"], value);
 }
Exemple #3
0
 public void DOMStringMapIEnumerableWorking()
 {
     var div = new HTMLDivElement();
     div.SetAttribute("data-some", "test");
     div.SetAttribute("data-another", "");
     div.SetAttribute("data-test", "third attribute");
     Assert.AreEqual(3, div.Dataset.Count());
     Assert.AreEqual("some", div.Dataset.First().Key);
     Assert.AreEqual("test", div.Dataset.First().Value);
     Assert.AreEqual("test", div.Dataset.Last().Key);
     Assert.AreEqual("third attribute", div.Dataset.Last().Value);
 }