Takes a Gecko element or an XmlElement, and then provides a few simple operations on the element so that the client doesn't have to know which it has. This is useful because it would be hard to introduce gecko elements in many simple unit tests.
 public void EqualsProxyForSameThing_ReturnsTrue()
 {
     var dom = new XmlDocument();
     dom.LoadXml("<div id='foo'/>");
     var elementProxy = new ElementProxy(dom.DocumentElement);
     var proxy2 = new ElementProxy(dom.DocumentElement);
     Assert.That(elementProxy == proxy2, Is.True);
     Assert.That(elementProxy.Equals(proxy2), Is.True);
 }
示例#2
0
        private static bool HasClass(ElementProxy element, string className)
        {
            var elementClassName = element._geckoElement?.ClassName ?? element._xmlElement.Attributes["class"].Value;

            return(((IList)elementClassName.Split(' ')).Contains(className));
        }