當前位置: 首頁>>代碼示例>>C#>>正文


C# TestUtils.CreateEmptySolution方法代碼示例

本文整理匯總了C#中Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.CreateEmptySolution方法的典型用法代碼示例。如果您正苦於以下問題:C# TestUtils.CreateEmptySolution方法的具體用法?C# TestUtils.CreateEmptySolution怎麽用?C# TestUtils.CreateEmptySolution使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.VsSDK.IntegrationTestLibrary.TestUtils的用法示例。


在下文中一共展示了TestUtils.CreateEmptySolution方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateEmptySolution

 public void CreateEmptySolution()
 {
     var testUtils = new TestUtils();
     testUtils.CloseCurrentSolution(
             __VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave );
     testUtils.CreateEmptySolution( TestContext.TestDir, "EmptySolution" );
 }
開發者ID:IntelliTect,項目名稱:PowerStudio,代碼行數:7,代碼來源:SolutionTests.cs

示例2: CreateEmptySolution

 public void CreateEmptySolution() {
     UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
         var testUtils = new TestUtils();
         testUtils.CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave);
         testUtils.CreateEmptySolution(TestContext.TestDir, "EmptySolution");
     });
 }
開發者ID:samukce,項目名稱:show-my-git-branch,代碼行數:7,代碼來源:SolutionTests.cs

示例3: VBWinformsApplication

        public void VBWinformsApplication() {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
                //Solution and project creation parameters
                var solutionName = "VBWinApp";
                var projectName = "VBWinApp";

                //Template parameters
                var language = "VisualBasic";
                var projectTemplateName = "WindowsApplication.Zip";
                var itemTemplateName = "CodeFile.zip";
                var newFileName = "Test.vb";

                var dte = (DTE) VsIdeTestHostContext.ServiceProvider.GetService(typeof (DTE));

                var testUtils = new TestUtils();

                testUtils.CreateEmptySolution(TestContext.TestDir, solutionName);
                Assert.AreEqual<int>(0, testUtils.ProjectCount());

                //Add new  Windows application project to existing solution
                testUtils.CreateProjectFromTemplate(projectName, projectTemplateName, language, false);

                //Verify that the new project has been added to the solution
                Assert.AreEqual<int>(1, testUtils.ProjectCount());

                //Get the project
                var project = dte.Solution.Item(1);
                Assert.IsNotNull(project);
                Assert.IsTrue(string.Compare(project.Name, projectName, StringComparison.InvariantCultureIgnoreCase) == 0);

                //Verify Adding new code file to project
                var newCodeFileItem = testUtils.AddNewItemFromVsTemplate(project.ProjectItems, itemTemplateName, language, newFileName);
                Assert.IsNotNull(newCodeFileItem, "Could not create new project item");
            });
        }
開發者ID:samukce,項目名稱:show-my-git-branch,代碼行數:35,代碼來源:VBProjectTests.cs

示例4: WinformsApplication

        public void WinformsApplication()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate
            {
                var testUtils = new TestUtils();

                testUtils.CreateEmptySolution(TestContext.TestDir, "CSWinApp");
                Assert.AreEqual(0, testUtils.ProjectCount());

                //Create Winforms application project
                //TestUtils.CreateProjectFromTemplate("MyWindowsApp", "Windows Application", "CSharp", false);
                //Assert.AreEqual<int>(1, TestUtils.ProjectCount());
            });
        }
開發者ID:modulexcite,項目名稱:tfsautoshelve,代碼行數:14,代碼來源:CSharpProjectTests.cs

示例5: CppWinformsApplication

        public void CppWinformsApplication()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate
            {
                //Solution and project creation parameters
                const string solutionName = "CPPWinApp";
                const string projectName = "CPPWinApp";

                //Template parameters
                const string projectType = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
                var projectTemplateName = Path.Combine("vcNet", "mc++appwiz.vsz");

                const string itemTemplateName = "newc++file.cpp";
                const string newFileName = "Test.cpp";

                var dte = (DTE) VsIdeTestHostContext.ServiceProvider.GetService(typeof (DTE));

                var testUtils = new TestUtils();

                testUtils.CreateEmptySolution(TestContext.TestDir, solutionName);
                Assert.AreEqual(0, testUtils.ProjectCount());

                //Add new CPP Windows application project to existing solution
                var solutionDirectory = Directory.GetParent(dte.Solution.FullName).FullName;
                var projectDirectory = TestUtils.GetNewDirectoryName(solutionDirectory, projectName);
                var projectTemplatePath = Path.Combine(dte.Solution.TemplatePath[projectType],
                    projectTemplateName);
                Assert.IsTrue(File.Exists(projectTemplatePath),
                    string.Format("Could not find template file: {0}", projectTemplatePath));
                dte.Solution.AddFromTemplate(projectTemplatePath, projectDirectory, projectName);

                //Verify that the new project has been added to the solution
                Assert.AreEqual(1, testUtils.ProjectCount());

                //Get the project
                Project project = dte.Solution.Item(1);
                Assert.IsNotNull(project);
                Assert.IsTrue(string.Compare(project.Name, projectName, StringComparison.InvariantCultureIgnoreCase) ==
                              0);

                //Verify Adding new code file to project
                string newItemTemplatePath = Path.Combine(dte.Solution.ProjectItemsTemplatePath(projectType),
                    itemTemplateName);
                Assert.IsTrue(File.Exists(newItemTemplatePath));
                ProjectItem item = project.ProjectItems.AddFromTemplate(newItemTemplatePath, newFileName);
                Assert.IsNotNull(item);
            });
        }
開發者ID:modulexcite,項目名稱:tfsautoshelve,代碼行數:48,代碼來源:CPPProjectTests.cs

示例6: WinformsApplication

        public void WinformsApplication() {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
                var testUtils = new TestUtils();

                testUtils.CreateEmptySolution(TestContext.TestDir, "CSWinApp");
                Assert.AreEqual<int>(0, testUtils.ProjectCount());

                //Create Winforms application project
                //TestUtils.CreateProjectFromTemplate("MyWindowsApp", "Windows Application", "CSharp", false);
                //Assert.AreEqual<int>(1, TestUtils.ProjectCount());

                //TODO Verify that we can debug launch the application

                //TODO Set Break point and verify that will hit

                //TODO Verify Adding new project item to project
            });
        }
開發者ID:samukce,項目名稱:show-my-git-branch,代碼行數:18,代碼來源:CSharpProjectTests.cs

示例7: ValidateNewFileOpenedWithEditor

        public void ValidateNewFileOpenedWithEditor()
        {
            UIThreadInvoker.Invoke((ThreadInvoker)delegate()
            {
                TestUtils testUtils = new TestUtils();
                testUtils.CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave);
                testUtils.CreateEmptySolution(TestContext.TestDir, "CreateEmptySolution");

                //Add new file to the solution and save all
                string name = "mynewfile";
                EnvDTE.DTE dte = VsIdeTestHostContext.Dte;
                EnvDTE.Window win = dte.ItemOperations.NewFile(@"Racket Files\Racket", name, EnvDTE.Constants.vsViewKindPrimary);
                Assert.IsNotNull(win);
                dte.ExecuteCommand("File.SaveAll", string.Empty);

                //get the currect misc files state
                object OriginalValueMiscFilesSavesLastNItems = dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value;
                if ((int)OriginalValueMiscFilesSavesLastNItems == 0)
                {
                    dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value = 5;
                }

                //get a handle to the project item in the solution explorer
                EnvDTE.ProjectItem item = win.Document.ProjectItem;
                Assert.IsNotNull(item);

                //close window
                win.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo);

                //reset the miscfiles property if it was modified
                if (OriginalValueMiscFilesSavesLastNItems != dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value)
                {
                    dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value = OriginalValueMiscFilesSavesLastNItems;
                }

            });
        }
開發者ID:Graham-Pedersen,項目名稱:IronPlot,代碼行數:37,代碼來源:EditorTest.cs


注:本文中的Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.CreateEmptySolution方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。