public ProjectTemplateTester(string projectFilePath, string tempDirectoryPath) { this.projectDirectoryPath = Path.GetDirectoryName(projectFilePath); if (string.IsNullOrEmpty(tempDirectoryPath)) { this.tempDirectoryPath = Path.Combine( Path.GetTempPath(), Path.GetFileNameWithoutExtension(projectFilePath) + "-" + Guid.NewGuid().ToString()); } else { this.tempDirectoryPath = Path.Combine( tempDirectoryPath, Path.GetFileNameWithoutExtension(projectFilePath) + "-" + Guid.NewGuid().ToString()); } DirectoryExtended.Copy(this.projectDirectoryPath, this.tempDirectoryPath); var container = new ContainerBuilder() .RegisterServices(Path.Combine(this.tempDirectoryPath, "Boilerplate.AspNetCore.Sample.xproj")) .RegisterFeatureSet(FeatureSet.Mvc6) .Build(); this.features = new FeatureCollection(container.Resolve <IEnumerable <IFeature> >()); this.fileSystemService = container.Resolve <IFileSystemService>(); }
public async Task AssertNpmInstallSucceeded() { await this.EnsureNpmCacheInitialized(); DirectoryExtended.Copy(this.npmModulesDirectoryPath, Path.Combine(this.tempDirectoryPath, "node_modules")); await ProcessAssert.AssertStart(this.tempDirectoryPath, GetNpmFilePath(), "install", TimeSpan.FromMinutes(5)); }
public MVC6SampleTest() { this.projectDirectoryPath = ConfigurationManager.AppSettings["ProjectDirectoryPath"]; this.tempDirectoryPath = ConfigurationManager.AppSettings["TempDirectoryPath"] + Guid.NewGuid().ToString(); DirectoryExtended.Copy(this.projectDirectoryPath, this.tempDirectoryPath); var container = new ContainerBuilder() .RegisterServices(Path.Combine(this.tempDirectoryPath, "Boilerplate.AspNetCore.Sample.xproj")) .RegisterFeatureSet(FeatureSet.Mvc6) .Build(); this.features = new FeatureCollection(container.Resolve <IEnumerable <IFeature> >()); this.fileSystemService = container.Resolve <IFileSystemService>(); }
public ProjectTemplateTester(string projectFilePath, string tempDirectoryPath) { this.projectDirectoryPath = Path.GetDirectoryName(projectFilePath); this.tempDirectoryPath = Path.Combine( tempDirectoryPath, Path.GetFileNameWithoutExtension(projectFilePath) + "-" + Guid.NewGuid().ToString()); var tempProjectFilePath = Path.Combine(this.tempDirectoryPath, Path.GetFileName(projectFilePath)); this.npmCacheDirectoryPath = Path.Combine(tempDirectoryPath, "npm"); this.npmModulesDirectoryPath = Path.Combine(this.npmCacheDirectoryPath, "node_modules"); DirectoryExtended.Copy(this.projectDirectoryPath, this.tempDirectoryPath); var container = new ContainerBuilder() .RegisterServices(tempProjectFilePath) .RegisterFeatureSet(FeatureSet.Mvc6) .Build(); this.features = new FeatureCollection(container.Resolve <IEnumerable <IFeature> >()); this.fileSystemService = container.Resolve <IFileSystemService>(); }