Ejemplo n.º 1
0
        public void MultiSelectCopyAndPaste()
        {
            DebugProject.OpenProject(@"Python.VS.TestData\DebuggerProject.sln");

            var app = new VisualStudioApp(VsIdeTestHostContext.Dte);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            var folderNode = window.FindItem("Solution 'DebuggerProject' (1 project)", "DebuggerProject", "BreakAllTest.py");

            folderNode.SetFocus();

            Keyboard.Press(Key.LeftShift);
            Keyboard.PressAndRelease(Key.Down);
            Keyboard.PressAndRelease(Key.Down);
            Keyboard.Release(Key.LeftShift);
            Keyboard.ControlC();

            var projectNode = window.FindItem("Solution 'DebuggerProject' (1 project)", "DebuggerProject");

            projectNode.SetFocus();
            Keyboard.ControlV();

            Assert.AreNotEqual(null, window.WaitForItem("Solution 'DebuggerProject' (1 project)", "DebuggerProject", "BreakAllTest - Copy.py"));
            Assert.AreNotEqual(null, window.WaitForItem("Solution 'DebuggerProject' (1 project)", "DebuggerProject", "BreakpointTest - Copy.py"));
            Assert.AreNotEqual(null, window.WaitForItem("Solution 'DebuggerProject' (1 project)", "DebuggerProject", "BreakpointTest2 - Copy.py"));
        }
Ejemplo n.º 2
0
        public void CopyPasteFile()
        {
            var project = DebugProject.OpenProject(@"Python.VS.TestData\HelloWorld.sln");

            var app = new VisualStudioApp(VsIdeTestHostContext.Dte);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            // find Program.py, send copy & paste, verify copy of file is there
            var programPy = window.FindItem("Solution 'HelloWorld' (1 project)", "HelloWorld", "Program.py");

            programPy.SetFocus();

            Keyboard.ControlC();
            Keyboard.ControlV();

            Assert.AreNotEqual(null, window.WaitForItem("Solution 'HelloWorld' (1 project)", "HelloWorld", "Program - Copy.py"));

            programPy.SetFocus();
            Keyboard.ControlC();
            Keyboard.ControlV();

            Assert.AreNotEqual(null, window.WaitForItem("Solution 'HelloWorld' (1 project)", "HelloWorld", "Program - Copy (2).py"));
        }
Ejemplo n.º 3
0
        public void CopyFolderInToSelf()
        {
            DebugProject.OpenProject(@"Python.VS.TestData\HelloWorld2.sln", expectedProjects: 2);

            var app = new VisualStudioApp(VsIdeTestHostContext.Dte);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            var folder = window.FindItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder");

            folder.SetFocus();
            Keyboard.ControlC();

            var subItem = window.FindItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder", "SubItem.py");

            subItem.SetFocus();
            Keyboard.ControlV();
            VisualStudioApp.CheckMessageBox("Cannot copy 'TestFolder'. The destination folder is a subfolder of the source folder.");
        }
Ejemplo n.º 4
0
        public void CopyFolderOnToSelf()
        {
            DebugProject.OpenProject(@"Python.VS.TestData\HelloWorld2.sln", expectedProjects: 2);

            var app = new VisualStudioApp(VsIdeTestHostContext.Dte);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            var folder = window.FindItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder");

            folder.SetFocus();

            Keyboard.ControlC();

            folder.SetFocus();
            Keyboard.ControlV();

            Assert.AreNotEqual(null, window.WaitForItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder - Copy"));
        }
Ejemplo n.º 5
0
        public void CutPaste()
        {
            DebugProject.OpenProject(@"Python.VS.TestData\HelloWorld2.sln", expectedProjects: 2);

            var app = new VisualStudioApp(VsIdeTestHostContext.Dte);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            var subItem = window.FindItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder", "SubItem.py");

            subItem.SetFocus();

            Keyboard.ControlX();

            var projectNode = window.FindItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2");

            projectNode.SetFocus();
            Keyboard.ControlV();

            Assert.AreNotEqual(null, window.WaitForItem("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "SubItem.py"));
            Assert.AreEqual(null, window.WaitForItemRemoved("Solution 'HelloWorld2' (2 projects)", "HelloWorld2", "TestFolder", "SubItem.py"));
        }