diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs index 27640090c8..d61d266085 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs @@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting ApplicationName = new DirectoryInfo(ApplicationPath).Name; ServerType = serverType; RuntimeFlavor = runtimeFlavor; - EnvironmentVariables.Add(new KeyValuePair("ASPNETCORE_DETAILEDERRORS", "true")); + EnvironmentVariables["ASPNETCORE_DETAILEDERRORS"] = "true"; } public ServerType ServerType { get; } @@ -103,12 +103,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting /// Environment variables to be set before starting the host. /// Not applicable for IIS Scenarios. /// - public List> EnvironmentVariables { get; } = new List>(); + public IDictionary EnvironmentVariables { get; } = new Dictionary(); /// /// Environment variables used when invoking dotnet publish. /// - public List> PublishEnvironmentVariables { get; } = new List>(); + public IDictionary PublishEnvironmentVariables { get; } = new Dictionary(); /// /// For any application level cleanup to be invoked after performing host cleanup. @@ -126,4 +126,4 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting PublishApplicationBeforeDeployment); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs index 6ec210ba07..d2370c9e27 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs @@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } } - protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, List> environmentVariables) + protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, IDictionary environmentVariables) { var environment = startInfo.Environment; SetEnvironmentVariable(environment, "ASPNETCORE_ENVIRONMENT", DeploymentParameters.EnvironmentName); diff --git a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs b/test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs index d9a17b70e7..341366bd8a 100644 --- a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs +++ b/test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs @@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests PublishApplicationBeforeDeployment = true }; - deploymentParameters.EnvironmentVariables.Add(new KeyValuePair("ASPNETCORE_STARTMECHANIC", "Run")); + deploymentParameters.EnvironmentVariables["ASPNETCORE_STARTMECHANIC"] = "Run"; using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory)) { @@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests PublishApplicationBeforeDeployment = true }; - deploymentParameters.EnvironmentVariables.Add(new KeyValuePair("ASPNETCORE_STARTMECHANIC", "WaitForShutdown")); + deploymentParameters.EnvironmentVariables["ASPNETCORE_STARTMECHANIC"] = "WaitForShutdown"; using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory)) {