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);
        }
        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);
        }