当前位置: 首页>>代码示例>>C#>>正文


C# TestUtils.ProjectCount方法代码示例

本文整理汇总了C#中Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.ProjectCount方法的典型用法代码示例。如果您正苦于以下问题:C# TestUtils.ProjectCount方法的具体用法?C# TestUtils.ProjectCount怎么用?C# TestUtils.ProjectCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.VsSDK.IntegrationTestLibrary.TestUtils的用法示例。


在下文中一共展示了TestUtils.ProjectCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: CPPWinformsApplication

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

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

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

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

                TestUtils testUtils = new TestUtils();

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

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

                //Verify that the new project has been added to the solution
                Assert.AreEqual<int>(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:SirkleZero,项目名称:savant,代码行数:45,代码来源:CPPProjectTests.cs

示例3: 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

示例4: 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


注:本文中的Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.ProjectCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。