public void DOMStringMapHasAttributesButRequestedMissing() { var document = new HtmlDocument(); var div = new HtmlDivElement(document); div.SetAttribute("data-some", "test"); div.SetAttribute("data-another", ""); div.SetAttribute("data-test", "third attribute"); Assert.IsTrue(div.Dataset["user"] == null); }
public void DOMStringMapIEnumerableWorking() { var document = new HtmlDocument(); var div = new HtmlDivElement(document); 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); }
public void DOMStringMapBindingGet() { var document = new HtmlDocument(); var value = "SomeUser"; var div = new HtmlDivElement(document); div.SetAttribute("data-user", value); Assert.AreEqual(div.Dataset["user"], value); }