Add new HeadersSent API.

This commit is contained in:
Chris Ross 2014-10-30 14:39:43 -07:00
parent 2762ac732f
commit 65f595ca02
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,8 @@ namespace Microsoft.AspNet.TestHost
public Stream Body { get; set; }
public bool HeadersSent { get; set; }
public void OnSendingHeaders(Action<object> callback, object state)
{
var prior = _sendingHeaders;
@ -43,6 +45,7 @@ namespace Microsoft.AspNet.TestHost
public void FireOnSendingHeaders()
{
_sendingHeaders();
HeadersSent = true;
}
}
}

View File

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