Пример #1
0
        public void VerifyOnlyElementsWithinRootSelected()
        {
            var root    = new XYFocusCUIElement();
            var subRoot = new XYFocusCUIElement();

            var current = new FocusableXYFocusCUIElement();

            var candidate  = new FocusableXYFocusCUIElement();
            var candidateB = new FocusableXYFocusCUIElement();
            var candidateC = new FocusableXYFocusCUIElement();

            var targetList = new List <DependencyObject>();

            targetList.Add(candidateB);
            targetList.Add(candidateC);

            root.AddChild(candidate);
            root.AddChild(subRoot);

            subRoot.AddChild(candidateB);

            candidateB.AddChild(candidateC);

            var candidateList = FindElements(subRoot, current, null, true, false);

            Assert.IsTrue(candidateList.Count == 2);
            VerifyResult(candidateList, targetList);
        }
Пример #2
0
        public void VerifyRecursiveSearchOfElements()
        {
            var root    = new XYFocusCUIElement();
            var subRoot = new XYFocusCUIElement();

            var current = new FocusableXYFocusCUIElement();

            var candidate  = new FocusableXYFocusCUIElement();
            var candidateB = new FocusableXYFocusCUIElement();
            var candidateC = new FocusableXYFocusCUIElement();

            List <DependencyObject> targetList = new List <DependencyObject>();

            targetList.Add(candidate);
            targetList.Add(candidateB);
            targetList.Add(candidateC);

            root.AddChild(candidate);
            root.AddChild(subRoot);

            subRoot.AddChild(candidateB);

            candidateB.AddChild(candidateC);

            var candidateList = FindElements(root, current, null, true, false);

            Assert.IsTrue(candidateList.Count == 3);
            VerifyResult(candidateList, targetList);
        }
Пример #3
0
        public void VerifyCurrentElementNotIncludedInList()
        {
            var root = new XYFocusCUIElement();

            var current = new FocusableXYFocusCUIElement();

            root.AddChild(current);

            var candidateList = FindElements(root, current, null, true, false);

            Assert.IsTrue(candidateList.Count == 0);
        }
Пример #4
0
        public void VerifyFindElement()
        {
            var root = new XYFocusCUIElement();

            var current   = new FocusableXYFocusCUIElement();
            var candidate = new FocusableXYFocusCUIElement();

            root.AddChild(candidate);

            var candidateList = FindElements(root, current, null, true, false);

            Assert.IsTrue(candidateList.Count == 1);
            VerifyAreEqual(candidateList[0].Element, candidate);
        }
Пример #5
0
        public void VerifyElementParticipatingInScrollAddedToList()
        {
            var root         = new XYFocusCUIElement();
            var scrollviewer = new ScrollViewer();

            var current   = new FocusableXYFocusCUIElement();
            var candidate = new FocusableXYFocusCUIElement();

            root.AddChild(scrollviewer);
            scrollviewer.AddChild(candidate);

            var candidateList = FindElements(root, current, scrollviewer, true, false);

            Assert.IsTrue(candidateList.Count == 1);
            VerifyAreEqual(candidateList[0].Element, candidate);
        }
Пример #6
0
        public void VerifyOccludedElementInNonActiveScrollviewerNotAddedToList()
        {
            var root          = new XYFocusCUIElement();
            var scrollviewer  = new ScrollViewer();
            var scrollviewerB = new ScrollViewer();

            var current   = new FocusableXYFocusCUIElement();
            var candidate = new FocusableXYFocusCUIElement();

            //Expect(*candidate, IsOccluded)
            //	.ReturnValue(true);

            root.AddChild(scrollviewer);
            scrollviewer.AddChild(candidate);

            var candidateList = FindElements(root, current, scrollviewerB, true, false);

            Assert.IsTrue(candidateList.Count == 0);
        }
Пример #7
0
        public void VerifyElementPartOfNestedScrollingScrollviewerAddedToList()
        {
            var root          = new XYFocusCUIElement();
            var scrollviewer  = new ScrollViewer();
            var scrollviewerB = new ScrollViewer();

            var current   = new FocusableXYFocusCUIElement();
            var candidate = new FocusableXYFocusCUIElement();

            //TODO:MZ: This has to be done somehow (in multiple tests in this file)
            //Expect(*candidate, IsOccluded)
            //	.ReturnValue(true);

            root.AddChild(scrollviewer);
            scrollviewer.AddChild(scrollviewerB);
            scrollviewer.AddChild(candidate);

            var candidateList = FindElements(root, current, scrollviewerB, true, false);

            Assert.IsTrue(candidateList.Count == 1);
            VerifyAreEqual(candidateList[0].Element, candidate);
        }