Exemplo n.º 1
0
        protected void InitializeE2E(string testCaseName, bool createUniqueProject = false, string targetFramework = null, string sdkVersion = null)
        {
            InitializeUnitTest(testCaseName, createProject: false);
            this_TestCaseLogger = new TestLogger()
            {
                Verbose = true
            };

            Directory.CreateDirectory(this_TestCaseBootstrapDir);

            this_TestCaseSdkVersion = sdkVersion ?? g_SdkVersion;

            if (sdkVersion != null)
            {
                CreateGlobalJson(createUniqueProject ? this_TestCaseOutputDir : this_TestGroupOutputDir, sdkVersion);
            }

            if (createUniqueProject)
            {
                // create a project specific to the test case.
                var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj");
                this_TestCaseProject = ProjectUtils.GetProject(projectPath, targetFramework, forceNew: true, build: true, logger: this_TestCaseLogger);
            }
            else
            {
                this_TestCaseProject = this_TestGroupProject;
            }
        }
Exemplo n.º 2
0
        public void InitializeGlobal(string testCaseName, string targetFramework = null, string sdkVersion = null)
        {
            InitializeUnitTest(testCaseName, createProject: false);
            this_TestCaseLogger = new TestLogger()
            {
                Verbose = true
            };

            Directory.CreateDirectory(this_TestCaseBootstrapDir);

            this_TestCaseSdkVersion = sdkVersion ?? g_SdkVersion;

            if (sdkVersion != null)
            {
                CreateGlobalJson(this_TestCaseOutputDir, sdkVersion);
            }

            // create a project specific to the test case.
            var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj");

            this_TestCaseProject = ProjectUtils.GetProject(projectPath, targetFramework, forceNew: true, build: true, logger: this_TestCaseLogger, globalTool: true);
        }