Added test for Addresses

This commit is contained in:
Kristian Hellang 2015-12-07 15:22:39 +01:00
parent 50f95cbbc0
commit bfad32f223
1 changed files with 19 additions and 0 deletions

View File

@ -43,6 +43,25 @@ namespace Microsoft.AspNet.Server.KestrelTests
Assert.Equal(expected, information.ThreadCount);
}
[Fact]
public void SetAddressesUsingConfiguration()
{
var expected = new List<string> { "http://localhost:1337", "https://localhost:42" };
var values = new Dictionary<string, string>
{
{ "server.urls", string.Join(";", expected) }
};
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(values)
.Build();
var information = new KestrelServerInformation(configuration);
Assert.Equal(expected, information.Addresses);
}
private static int Clamp(int value, int min, int max)
{
return value < min ? min : value > max ? max : value;