Пример #1
0
        public void TestCompileAspNet(string version, string appType)
        {
            string projectName = $"TestGcpAspNet{appType}";

            CreateProjectFromTemplate(projectName, "NetFramework", "Gcp.AspNet.vstemplate", version, appType);
            Solution.SolutionBuild.Build(true);

            Assert.AreEqual(vsBuildState.vsBuildStateDone, Solution.SolutionBuild.BuildState, projectName);
            Assert.AreEqual(0, Solution.SolutionBuild.LastBuildInfo,
                            $"{projectName} build output:{Environment.NewLine}{GetBuildOutput()}");
            string descriptions = string.Join(
                Environment.NewLine, ErrorItems.Select(e => e.Project + ":" + e.Description));

            Assert.AreEqual(0, ErrorItems.Count(e => e.Project == projectName),
                            $"{projectName} error descriptions:{Environment.NewLine}{descriptions}");
        }
Пример #2
0
        public void TestCompileAspNetCore(string version, string appType)
        {
            string projectName = $"TestGcpAspNetCore{appType}{version.Replace(".", "").Replace("-", "")}";

            CreateProjectFromTemplate(projectName, "NetCore", "Gcp.AspNetCore.vstemplate", version, appType);
            RestorePackages(Path.Combine(SolutionFolderPath, projectName));
            Solution.SolutionBuild.Build(true);

            Assert.AreEqual(vsBuildState.vsBuildStateDone, Solution.SolutionBuild.BuildState, projectName);
            Assert.AreEqual(
                0, Solution.SolutionBuild.LastBuildInfo,
                $"{projectName} build output:{Environment.NewLine}{GetBuildOutput()}");
            string descriptions = string.Join(
                Environment.NewLine, ErrorItems.Select(e => e.Project + ":" + e.Description));

            Assert.AreEqual(
                0, ErrorItems.Count(e => e.Project == $"Test{projectName}Project"),
                $"{projectName} error descriptions:{Environment.NewLine}{descriptions}");
        }
Пример #3
0
        public void TestCompile()
        {
            TemplateName = Convert.ToString(TestContext.DataRow[0]);
            bool isCoreTemplate = Convert.ToBoolean(TestContext.DataRow[1]);

            CreateProjectFromTemplate();
            if (isCoreTemplate)
            {
                RestorePackages();
            }
            Solution.SolutionBuild.Build(true);

            Assert.AreEqual(vsBuildState.vsBuildStateDone, Solution.SolutionBuild.BuildState, TemplateName);
            Assert.AreEqual(0, Solution.SolutionBuild.LastBuildInfo,
                            $"{TemplateName} build output:{Environment.NewLine}{GetBuildOutput()}");
            string descriptions = string.Join(
                Environment.NewLine, ErrorItems.Select(e => e.Project + ":" + e.Description));

            Assert.AreEqual(0, ErrorItems.Count(e => e.Project == ProjectName),
                            $"{TemplateName} error descriptions:{Environment.NewLine}{descriptions}");
        }