public MicroserviceTest( string publishedWebsiteFolderPath, NameValueCollection appSettingsToBeUpdatedBeforeDeploy, int clientTimeOutInMin = 2, DeployLocation deployLocation = DeployLocation.IISExpress, DeployArchitecture deployArch = DeployArchitecture.x86, bool redirectOutput = false) { // Create a new folder, copy the published website to this folder and deploy from there // This is needed because when hybrid tests run, we deploy both cloud and onprem from same location, // resulting in sometimes receiving appsettings have been updated outside of process by MessageHandler string directoryPath = Path.Combine(System.Environment.CurrentDirectory, Guid.NewGuid().ToString()); Directory.CreateDirectory(directoryPath); DirectoryCopy(publishedWebsiteFolderPath, directoryPath, true); this.PublishedWebsiteFolderPath = directoryPath; this.deployLocation = deployLocation; this.deployArchitecture = deployArch; this.AppSettingsToBeUpdatedBeforeDeploy = appSettingsToBeUpdatedBeforeDeploy; this.clientTimeOutInMin = TimeSpan.FromMinutes(clientTimeOutInMin); this.redirectOutput = redirectOutput; }
// for scenario where website is already deployed public MicroserviceTest(string baseAddressOfWebsite, int clientTimeOutInMin = 2) { this.baseAddressOfWebsite = baseAddressOfWebsite; this.deployLocation = DeployLocation.Cloud; this.clientTimeOutInMin = TimeSpan.FromMinutes(clientTimeOutInMin); }