Exemplo n.º 1
0
        /// <summary>
        /// Selects the solution node using the mouse.
        ///
        /// This is used to reset the state of the mouse before a test as some
        /// tests can cause the mouse to be left in an odd state - the mouse up
        /// event is delivered to solution explorer, but selecting items later
        /// doesn't work because the mouse is left in an odd state.  If you
        /// make this method a nop and try and run all of the tests you'll
        /// see the bad behavior.
        /// </summary>
        public void SelectSolutionNode()
        {
            // May need to reopen Solution Explorer so we can find a clickable
            // point.
            _solutionExplorer = _app.OpenSolutionExplorer();
            var item = SolutionExplorer.WaitForItem(SolutionNodeText);

            SolutionExplorer.CenterInView(item);
            Mouse.MoveTo(item.GetClickablePoint());
            Mouse.Click(MouseButton.Left);
        }