public async Task <Project> GetOrCreateProject(string projectKey, ITestOutputHelper output)
        {
            await TemplatePackageInstaller.EnsureTemplatingEngineInitializedAsync(output);

            return(_projects.GetOrAdd(
                       projectKey,
                       (key, outputHelper) =>
            {
                var project = new Project
                {
                    DotNetNewLock = DotNetNewLock,
                    NodeLock = NodeLock,
                    Output = outputHelper,
                    DiagnosticsMessageSink = DiagnosticsMessageSink,
                    ProjectGuid = Guid.NewGuid().ToString("N").Substring(0, 6)
                };
                project.ProjectName = $"AspNet.{key}.{project.ProjectGuid}";

                var assemblyPath = GetType().Assembly;
                string basePath = GetTemplateFolderBasePath(assemblyPath);
                project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName);
                return project;
            },
                       output));
        }
        public async Task <Project> GetOrCreateProject(string projectKey, ITestOutputHelper output)
        {
            await TemplatePackageInstaller.EnsureTemplatingEngineInitializedAsync(output);

            // Different tests may have different output helpers, so need to fix up the output to write to the correct log
            if (_projects.TryGetValue(projectKey, out var project))
            {
                project.Output = output;
                return(project);
            }
            return(_projects.GetOrAdd(
                       projectKey,
                       (key, outputHelper) =>
            {
                var project = new Project
                {
                    Output = outputHelper,
                    DiagnosticsMessageSink = DiagnosticsMessageSink,
                    ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty)
                };
                project.ProjectName = $"AspNet.{project.ProjectGuid}";

                var assemblyPath = GetType().Assembly;
                var basePath = GetTemplateFolderBasePath(assemblyPath);
                project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName);
                return project;
            },
                       output));
        }
        public async Task <Project> GetOrCreateProject(string projectKey, ITestOutputHelper output)
        {
            await TemplatePackageInstaller.EnsureTemplatingEngineInitializedAsync(output);

            return(_projects.GetOrAdd(
                       projectKey,
                       (key, outputHelper) =>
            {
                var project = new Project
                {
                    Output = outputHelper,
                    DiagnosticsMessageSink = DiagnosticsMessageSink,
                    ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty)
                };
                project.ProjectName = $"AspNet.{project.ProjectGuid}";

                var assemblyPath = GetType().Assembly;
                var basePath = GetTemplateFolderBasePath(assemblyPath);
                project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName);
                return project;
            },
                       output));
        }