Exemple #1
0
        public void VerifyMissingOrientationFails()
        {
            TestType(AutomationControlType.ScrollBar);
            TestType(AutomationControlType.Tab);

            void TestType(AutomationControlType elementType)
            {
                var peer = new NoneOrientationPeer(new Button(), elementType);

                var rule = new OrientationNotNoneRule();

                Assert.IsFalse(rule.IsValid(null, peer));
            }
        }
Exemple #2
0
        public void VerifyNormalElementsComply()
        {
            ProcessElement(new Button());
            ProcessElement(new ScrollBar());
            ProcessElement(new TextBlock());
            ProcessElement(new StackPanel());

            void ProcessElement(FrameworkElement element)
            {
                var peer = FrameworkElementAutomationPeer.CreatePeerForElement(element);

                var rule = new OrientationNotNoneRule();

                Assert.IsTrue(rule.IsValid(element, peer));
            }
        }