Removed irrelevant tests
This commit is contained in:
parent
c5e8120e39
commit
41b4e6017e
|
|
@ -66,47 +66,10 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
Assert.Throws<ArgumentNullException>(() => CreateBuilder().UseStartup((string)null));
|
Assert.Throws<ArgumentNullException>(() => CreateBuilder().UseStartup((string)null));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void CanStartWithOldServerConfig()
|
|
||||||
{
|
|
||||||
var vals = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddInMemoryCollection(vals);
|
|
||||||
var config = builder.Build();
|
|
||||||
var host = CreateBuilder(config).UseServer(this).Build();
|
|
||||||
host.Start();
|
|
||||||
Assert.NotNull(host.Services.GetService<IHostingEnvironment>());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void CanStartWithServerConfig()
|
|
||||||
{
|
|
||||||
var vals = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddInMemoryCollection(vals);
|
|
||||||
var config = builder.Build();
|
|
||||||
var host = CreateBuilder(config).UseServer(this).Build();
|
|
||||||
host.Start();
|
|
||||||
Assert.NotNull(host.Services.GetService<IHostingEnvironment>());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void CanDefaultAddressesIfNotConfigured()
|
public void CanDefaultAddressesIfNotConfigured()
|
||||||
{
|
{
|
||||||
var vals = new Dictionary<string, string>
|
var host = CreateBuilder().UseServer(this).Build();
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddInMemoryCollection(vals);
|
|
||||||
var config = builder.Build();
|
|
||||||
var host = CreateBuilder(config).UseServer(this).Build();
|
|
||||||
host.Start();
|
host.Start();
|
||||||
Assert.NotNull(host.Services.GetService<IHostingEnvironment>());
|
Assert.NotNull(host.Services.GetService<IHostingEnvironment>());
|
||||||
Assert.Equal("http://localhost:5000", host.ServerFeatures.Get<IServerAddressesFeature>().Addresses.First());
|
Assert.Equal("http://localhost:5000", host.ServerFeatures.Get<IServerAddressesFeature>().Addresses.First());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue