Add new HeadersSent API.
This commit is contained in:
parent
2762ac732f
commit
65f595ca02
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ namespace Microsoft.AspNet.TestHost
|
|||
|
||||
// Assert
|
||||
Assert.Equal(200, responseInformation.StatusCode);
|
||||
Assert.False(responseInformation.HeadersSent);
|
||||
|
||||
responseInformation.FireOnSendingHeaders();
|
||||
|
||||
Assert.True(responseInformation.HeadersSent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue