#272 Make HostingEnvironment default to Production.

This commit is contained in:
Chris R 2015-05-15 11:59:13 -07:00
parent 5b851c49a3
commit 0e87d989d7
2 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Hosting
{
public class HostingEnvironment : IHostingEnvironment
{
internal const string DefaultEnvironmentName = "Development";
internal const string DefaultEnvironmentName = "Production";
public string EnvironmentName { get; set; } = DefaultEnvironmentName;

View File

@ -140,15 +140,15 @@ namespace Microsoft.AspNet.Hosting
}
[Fact]
public void EnvDefaultsToDevelopmentIfNoConfig()
public void EnvDefaultsToProductionIfNoConfig()
{
var engine = CreateBuilder().Build();
var env = engine.ApplicationServices.GetRequiredService<IHostingEnvironment>();
Assert.Equal("Development", env.EnvironmentName);
Assert.Equal("Production", env.EnvironmentName);
}
[Fact]
public void EnvDefaultsToDevelopmentConfigValueIfSpecifiedWithOldKey()
public void EnvDefaultsToConfigValueIfSpecifiedWithOldKey()
{
var vals = new Dictionary<string, string>
{
@ -164,7 +164,7 @@ namespace Microsoft.AspNet.Hosting
}
[Fact]
public void EnvDefaultsToDevelopmentConfigValueIfSpecified()
public void EnvDefaultsToConfigValueIfSpecified()
{
var vals = new Dictionary<string, string>
{
@ -195,8 +195,8 @@ namespace Microsoft.AspNet.Hosting
using (engine.Start())
{
var env = engine.ApplicationServices.GetRequiredService<IHostingEnvironment>();
Assert.True(env.IsEnvironment("Development"));
Assert.True(env.IsEnvironment("developMent"));
Assert.True(env.IsEnvironment("Production"));
Assert.True(env.IsEnvironment("producTion"));
}
}