public void UITestControlCollection_Contains()
        {
            UITestControlCollection siblings = CheckBox.GetParent().GetChildren();

            siblings.Should().NotBeNullOrEmpty("because the CheckBox should have siblings");

            var firstItem = siblings.First();

            siblings
            .Contains(firstItem)
            .Should()
            .BeTrue("because collection should contain its first Item.");
        }
Exemplo n.º 2
0
        public void PinPane()
        {
            // Find the explorer main window
            UITestControl anItem = this.UIBusinessDesignStudioWindow;

            anItem.Find();

            // Find the explorer sub window
            UITestControl DocManager = new UITestControl(anItem);

            DocManager.SearchProperties["AutomationId"] = "UI_DocManager_AutoID";
            DocManager.Find();

            // Find the left pane window
            UITestControl DockLeft = new UITestControl(DocManager);

            DockLeft.SearchProperties["AutomationId"] = "DockLeft";
            DockLeft.Find();

            // Find the tab page window
            UITestControlCollection dockLeftChildren = DockLeft.GetChildren()[0].GetChildren();
            //var TabPage = dockLeftChildren.FirstOrDefault(c => c.FriendlyName == "Explorer");
            var TabPage = dockLeftChildren[0];

            // Find the explorer sub window
            UITestControl ExplorerPane = new UITestControl(TabPage);

            ExplorerPane.SearchProperties["AutomationId"] = "UI_ExplorerPane_AutoID";
            ExplorerPane.Find();
            ExplorerPane.DrawHighlight();

            // Find the pin
            UITestControlCollection explorerChildren = ExplorerPane.GetChildren();
            var unpinControl = explorerChildren.First(c => c.FriendlyName == "unpinBtn");

            Mouse.Click(unpinControl);
        }