コード例 #1
0
ファイル: ProjectTests.cs プロジェクト: sarvex/nodejstools
        public void TestNewAzureProject()
        {
            using (var app = new VisualStudioApp()) {
                using (var newProjDialog = app.FileNewProject()) {
                    newProjDialog.FocusLanguageNode("JavaScript");

                    var azureApp = newProjDialog.ProjectTypes.FindItem(NodejsVisualStudioApp.JavaScriptAzureWebAppTemplate);
                    azureApp.Select();
                    newProjDialog.OK();
                }

                // wait for new solution to load...
                for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++)
                {
                    System.Threading.Thread.Sleep(250);
                }

                app.SolutionExplorerTreeView.WaitForItem(
                    "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                    app.Dte.Solution.Projects.Item(1).Name,
                    "server.js"
                    );
                app.SolutionExplorerTreeView.WaitForItem(
                    "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                    app.Dte.Solution.Projects.Item(1).Name,
                    "Web.config"
                    );
            }
        }
コード例 #2
0
        internal static void CreateProject(VisualStudioApp app, string languageName, string templateName, string location, string projectName, string expectedProjectItem)
        {
            using (var newProjDialog = app.FileNewProject())
            {
                newProjDialog.FocusLanguageNode(languageName);
                newProjDialog.Location    = location;
                newProjDialog.ProjectName = projectName;

                var djangoApp = newProjDialog.ProjectTypes.FindItem(templateName);
                djangoApp.Select();
                newProjDialog.OK();
            }

            // wait for new solution to load...
            for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++)
            {
                System.Threading.Thread.Sleep(250);
            }

            app.OpenSolutionExplorer().WaitForItem(
                "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                app.Dte.Solution.Projects.Item(1).Name,
                expectedProjectItem
                );
        }
コード例 #3
0
        public void DeferredSaveWithDot()
        {
            // http://pytools.codeplex.com/workitem/623
            // enable deferred saving on projects

            using (var app = new VisualStudioApp()) {
                var props     = app.Dte.get_Properties("Environment", "ProjectsAndSolution");
                var prevValue = props.Item("SaveNewProjects").Value;
                props.Item("SaveNewProjects").Value = false;
                app.OnDispose(() => props.Item("SaveNewProjects").Value = prevValue);

                // now run the test
                var newProjDialog = app.FileNewProject();

                newProjDialog.FocusLanguageNode("JavaScript");

                var consoleApp = newProjDialog.ProjectTypes.FindItem("Blank Node.js Application");
                consoleApp.Select();
                newProjDialog.ProjectName = "Fob.Baz";
                newProjDialog.ClickOK();

                // wait for new solution to load...
                for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++)
                {
                    System.Threading.Thread.Sleep(1000);
                }

                TestUtils.DteExecuteCommandOnThreadPool("File.SaveAll");

                var saveProjDialog = new SaveProjectDialog(app.WaitForDialog());
                saveProjDialog.Save();

                app.WaitForDialogDismissed();

                var fullname = app.Dte.Solution.FullName;
                app.Dte.Solution.Close(false);

                Directory.Delete(Path.GetDirectoryName(fullname), true);
            }
        }
コード例 #4
0
        internal static void CreateProject(VisualStudioApp app, string languageName, string templateName, string location, string projectName, string expectedProjectItem) {
            using (var newProjDialog = app.FileNewProject()) {
                newProjDialog.FocusLanguageNode(languageName);
                newProjDialog.Location = location;
                newProjDialog.ProjectName = projectName;

                var djangoApp = newProjDialog.ProjectTypes.FindItem(templateName);
                djangoApp.Select();
                newProjDialog.OK();
            }

            // wait for new solution to load...
            for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) {
                System.Threading.Thread.Sleep(250);
            }

            app.OpenSolutionExplorer().WaitForItem(
                "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                app.Dte.Solution.Projects.Item(1).Name,
                expectedProjectItem
            );
        }
コード例 #5
0
ファイル: UITests.cs プロジェクト: paladique/nodejstools
        public void DeferredSaveWithDot() {
            // http://pytools.codeplex.com/workitem/623
            // enable deferred saving on projects

            using (var app = new VisualStudioApp()) {
                var props = app.Dte.get_Properties("Environment", "ProjectsAndSolution");
                var prevValue = props.Item("SaveNewProjects").Value;
                props.Item("SaveNewProjects").Value = false;
                app.OnDispose(() => props.Item("SaveNewProjects").Value = prevValue);

                // now run the test
                var newProjDialog = app.FileNewProject();

                newProjDialog.FocusLanguageNode("JavaScript");

                var consoleApp = newProjDialog.ProjectTypes.FindItem("Blank Node.js Application");
                consoleApp.Select();
                newProjDialog.ProjectName = "Fob.Baz";
                newProjDialog.ClickOK();

                // wait for new solution to load...
                for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++) {
                    System.Threading.Thread.Sleep(1000);
                }

                TestUtils.DteExecuteCommandOnThreadPool("File.SaveAll");

                var saveProjDialog = new SaveProjectDialog(app.WaitForDialog());
                saveProjDialog.Save();

                app.WaitForDialogDismissed();

                var fullname = app.Dte.Solution.FullName;
                app.Dte.Solution.Close(false);

                Directory.Delete(Path.GetDirectoryName(fullname), true);
            }
        }
コード例 #6
0
ファイル: ProjectTests.cs プロジェクト: shijiong/ntvsiot
        public void TestNewProject()
        {
            using (var app = new VisualStudioApp()) {
                using (var newProjDialog = app.FileNewProject()) {
                    newProjDialog.FocusLanguageNode("JavaScript");
                    var nodejsApp = newProjDialog.ProjectTypes.FindItem("Basic Node.js Web Server (Windows Universal)");
                    nodejsApp.Select();

                    newProjDialog.OK();
                }

                // wait for new solution to load...
                for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++)
                {
                    System.Threading.Thread.Sleep(250);
                }

                app.SolutionExplorerTreeView.WaitForItem(
                    "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                    app.Dte.Solution.Projects.Item(1).Name,
                    "server.js"
                    );
            }
        }
コード例 #7
0
ファイル: UITests.cs プロジェクト: rsumner33/PTVS
        public void NewProject()
        {
            var app           = new VisualStudioApp(VsIdeTestHostContext.Dte);
            var newProjDialog = app.FileNewProject();

            var item = newProjDialog.InstalledTemplates.FindItem("Other Languages", "Python");

            item.SetFocus();

            var consoleApp = newProjDialog.ProjectTypes.FindItem("Python Application");

            consoleApp.SetFocus();

            newProjDialog.ClickOK();

            // wait for new solution to load...
            for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++)
            {
                System.Threading.Thread.Sleep(1000);
            }

            Assert.AreEqual(1, app.Dte.Solution.Projects.Count);
            Assert.AreNotEqual(null, app.Dte.Solution.Projects.Item(1).ProjectItems.Item("Program.py"));
        }
コード例 #8
0
ファイル: ProjectTests.cs プロジェクト: munyirik/ntvsiot
        public void TestNewProject()
        {
            using (var app = new VisualStudioApp()) {
                using (var newProjDialog = app.FileNewProject()) {
                    newProjDialog.FocusLanguageNode("JavaScript");
                    var nodejsApp = newProjDialog.ProjectTypes.FindItem("Basic Node.js Web Server (Universal Windows)");
                    nodejsApp.Select();

                    newProjDialog.OK();
                }

                // wait for new solution to load...
                for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) {
                    System.Threading.Thread.Sleep(250);
                }

                app.SolutionExplorerTreeView.WaitForItem(
                    "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)",
                    app.Dte.Solution.Projects.Item(1).Name,
                    "server.js"
                );
            }
        }
コード例 #9
0
ファイル: NewItemDialog.cs プロジェクト: sramos30/ntvsiot
 public static NewProjectDialog FromDte(VisualStudioApp app) {
     return app.FileNewProject();
 }
コード例 #10
0
 public static NewProjectDialog FromDte(VisualStudioApp app)
 {
     return(app.FileNewProject());
 }