public void ShouldLimitPropertiesAccess(
            ElementAttributeAccessModifier scope,
            string expectedId,
            string expectedText,
            string expectedClr)
        {
            UiDispatch.Invoke(
                () =>
            {
                var element       = CreateTestElement();
                var winiumElement = new WiniumElement(element);

                var auotmationId = GetElementAttributeCommand.GetPropertyCascade(
                    winiumElement,
                    "AutomationProperties.AutomationId",
                    scope);

                var text = GetElementAttributeCommand.GetPropertyCascade(winiumElement, "Text", scope);

                var clr = GetElementAttributeCommand.GetPropertyCascade(winiumElement, "ClrProperty", scope);

                Assert.AreEqual(expectedId, auotmationId);
                Assert.AreEqual(expectedText, text);
                Assert.AreEqual(expectedClr, clr);
            }).Wait();
        }
        public void ShouldEncodeTagName()
        {
            UiDispatch.Invoke(
                () =>
            {
                var winiumElement = new WiniumElement(new TestControl());

                var sb = new StringBuilder();
                using (var writer = XmlWriter.Create(sb))
                {
                    PageSourceCommand.WriteElementToXml(writer, winiumElement);
                }

                var doc = new XmlDocument();
                doc.LoadXml(sb.ToString());
                var element = doc.DocumentElement;

                Assert.AreEqual(XmlConvert.EncodeLocalName(winiumElement.ClassName), element.LocalName);
                Assert.AreEqual(winiumElement.ClassName, element.GetAttribute("class_name"));
            }).Wait();
        }