React to OnSendingHeaders rename.

This commit is contained in:
Chris R 2015-06-12 14:38:03 -07:00
parent 62e5349773
commit c2b638d85b
2 changed files with 9 additions and 9 deletions

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNet.TestHost
{ {
internal class ResponseFeature : IHttpResponseFeature internal class ResponseFeature : IHttpResponseFeature
{ {
private Action _sendingHeaders = () => { }; private Action _responseStarting = () => { };
private Action _responseCompleted = () => { }; private Action _responseCompleted = () => { };
public ResponseFeature() public ResponseFeature()
@ -31,12 +31,12 @@ namespace Microsoft.AspNet.TestHost
public Stream Body { get; set; } public Stream Body { get; set; }
public bool HeadersSent { get; set; } public bool HasStarted { get; set; }
public void OnSendingHeaders(Action<object> callback, object state) public void OnResponseStarting(Action<object> callback, object state)
{ {
var prior = _sendingHeaders; var prior = _responseStarting;
_sendingHeaders = () => _responseStarting = () =>
{ {
callback(state); callback(state);
prior(); prior();
@ -55,8 +55,8 @@ namespace Microsoft.AspNet.TestHost
public void FireOnSendingHeaders() public void FireOnSendingHeaders()
{ {
_sendingHeaders(); _responseStarting();
HeadersSent = true; HasStarted = true;
} }
public void FireOnResponseCompleted() public void FireOnResponseCompleted()

View File

@ -15,11 +15,11 @@ namespace Microsoft.AspNet.TestHost
// Assert // Assert
Assert.Equal(200, responseInformation.StatusCode); Assert.Equal(200, responseInformation.StatusCode);
Assert.False(responseInformation.HeadersSent); Assert.False(responseInformation.HasStarted);
responseInformation.FireOnSendingHeaders(); responseInformation.FireOnSendingHeaders();
Assert.True(responseInformation.HeadersSent); Assert.True(responseInformation.HasStarted);
} }
} }
} }