Use dictionary for deployment parameters (#1126)

This commit is contained in:
Henk Mollema 2017-08-10 19:56:21 +02:00 committed by David Fowler
parent 07f96a444e
commit 456957bf57
3 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
ApplicationName = new DirectoryInfo(ApplicationPath).Name;
ServerType = serverType;
RuntimeFlavor = runtimeFlavor;
EnvironmentVariables.Add(new KeyValuePair<string, string>("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.
/// </summary>
public List<KeyValuePair<string, string>> EnvironmentVariables { get; } = new List<KeyValuePair<string, string>>();
public IDictionary<string, string> EnvironmentVariables { get; } = new Dictionary<string, string>();
/// <summary>
/// Environment variables used when invoking dotnet publish.
/// </summary>
public List<KeyValuePair<string, string>> PublishEnvironmentVariables { get; } = new List<KeyValuePair<string, string>>();
public IDictionary<string, string> PublishEnvironmentVariables { get; } = new Dictionary<string, string>();
/// <summary>
/// For any application level cleanup to be invoked after performing host cleanup.
@ -126,4 +126,4 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
PublishApplicationBeforeDeployment);
}
}
}
}

View File

@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
}
}
protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, List<KeyValuePair<string, string>> environmentVariables)
protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, IDictionary<string, string> environmentVariables)
{
var environment = startInfo.Environment;
SetEnvironmentVariable(environment, "ASPNETCORE_ENVIRONMENT", DeploymentParameters.EnvironmentName);

View File

@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests
PublishApplicationBeforeDeployment = true
};
deploymentParameters.EnvironmentVariables.Add(new KeyValuePair<string, string>("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<string, string>("ASPNETCORE_STARTMECHANIC", "WaitForShutdown"));
deploymentParameters.EnvironmentVariables["ASPNETCORE_STARTMECHANIC"] = "WaitForShutdown";
using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory))
{