Fix tests after rebase
This commit is contained in:
parent
7c46b2bd3b
commit
3c2408db68
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
/// in accordance with http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18
|
||||
/// </summary>
|
||||
/// <returns>The value.</returns>
|
||||
public string GetDateHeaderValue()
|
||||
public virtual string GetDateHeaderValue()
|
||||
{
|
||||
PumpTimer();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
[Fact]
|
||||
public void InitialDictionaryContainsServerAndDate()
|
||||
{
|
||||
var frame = new Frame(new ConnectionContext());
|
||||
var frame = new Frame(new ConnectionContext { DateHeaderValueManager = new DateHeaderValueManager() });
|
||||
IDictionary<string, StringValues> headers = frame.ResponseHeaders;
|
||||
|
||||
Assert.Equal(2, headers.Count);
|
||||
|
|
@ -37,13 +37,15 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
[Fact]
|
||||
public void InitialEntriesCanBeCleared()
|
||||
{
|
||||
IDictionary<string, StringValues> headers = new FrameResponseHeaders();
|
||||
var frame = new Frame(new ConnectionContext { DateHeaderValueManager = new DateHeaderValueManager() });
|
||||
|
||||
Assert.True(frame.ResponseHeaders.Count > 0);
|
||||
|
||||
headers.Clear();
|
||||
frame.ResponseHeaders.Clear();
|
||||
|
||||
Assert.Equal(0, headers.Count);
|
||||
Assert.False(headers.ContainsKey("Server"));
|
||||
Assert.False(headers.ContainsKey("Date"));
|
||||
Assert.Equal(0, frame.ResponseHeaders.Count);
|
||||
Assert.False(frame.ResponseHeaders.ContainsKey("Server"));
|
||||
Assert.False(frame.ResponseHeaders.ContainsKey("Date"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNet.Server.Kestrel.Http;
|
||||
|
||||
namespace Microsoft.AspNet.Server.KestrelTests
|
||||
{
|
||||
public class TestDateHeaderValueManager : DateHeaderValueManager
|
||||
{
|
||||
public override string GetDateHeaderValue()
|
||||
{
|
||||
return DateTimeOffset.UtcNow.ToString("r");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
{
|
||||
AppShutdown = new ShutdownNotImplemented();
|
||||
Log = new TestKestrelTrace();
|
||||
DateHeaderValueManager = new TestDateHeaderValueManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue