Provides a fake http response.
More...
|
override void | OnStarting (Func< object, Task > callback, object state) |
override void | OnCompleted (Func< object, Task > callback, object state) |
override void | Redirect (string location, bool permanent) |
void | SetContextAccessor (Func< HttpContext > accessor) |
| Set the http context accessor.
|
void | SetHeaders (IHeaderDictionary headers) |
| Set the response headers collection.
|
void | SetCookies (IResponseCookies cookies) |
| Set the cookies collection.
|
void | AddOnStartingHandler (Action< Func< object, Task >, object > handler) |
| Add a handler for when the request is starting.
|
void | AddOnCompletedHandler (Action< Func< object, Task >, object > handler) |
| Add a handler for when the request is completed.
|
void | AddRedirectHandler (Action< string, bool > handler) |
| Add a handler for when the request is redirected.
|
void | SetHasStarted (bool hasStarted) |
| Set the HasStarted property.
|
override Task | CompleteAsync () |
| Does nothing.
|
override Task | StartAsync (CancellationToken cancellationToken=new CancellationToken()) |
| Does nothing, really.
|
|
const string | DEFAULT_CONTENT_TYPE = "text/html" |
| The default content type for a response.
|
|
override HttpContext | HttpContext [get] |
override int | StatusCode [get, set] |
override IHeaderDictionary | Headers [get] |
override Stream | Body [get, set] |
override? long | ContentLength [get, set] |
override string | ContentType = DEFAULT_CONTENT_TYPE [get, set] |
override IResponseCookies | Cookies [get] |
override bool | HasStarted [get] |
override PipeWriter | BodyWriter [get] |
Provides a fake http response.
◆ AddOnCompletedHandler()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.AddOnCompletedHandler |
( |
Action< Func< object, Task >, object > | handler | ) |
|
Add a handler for when the request is completed.
- Parameters
-
◆ AddOnStartingHandler()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.AddOnStartingHandler |
( |
Action< Func< object, Task >, object > | handler | ) |
|
Add a handler for when the request is starting.
- Parameters
-
◆ AddRedirectHandler()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.AddRedirectHandler |
( |
Action< string, bool > | handler | ) |
|
Add a handler for when the request is redirected.
- Parameters
-
◆ CompleteAsync()
override Task PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.CompleteAsync |
( |
| ) |
|
◆ SetContextAccessor()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.SetContextAccessor |
( |
Func< HttpContext > | accessor | ) |
|
Set the http context accessor.
- Parameters
-
◆ SetCookies()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.SetCookies |
( |
IResponseCookies | cookies | ) |
|
Set the cookies collection.
- Parameters
-
◆ SetHasStarted()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.SetHasStarted |
( |
bool | hasStarted | ) |
|
Set the HasStarted property.
- Parameters
-
◆ SetHeaders()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.SetHeaders |
( |
IHeaderDictionary | headers | ) |
|
Set the response headers collection.
- Parameters
-
◆ StartAsync()
override Task PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpResponse.StartAsync |
( |
CancellationToken | cancellationToken = new CancellationToken() | ) |
|
Does nothing, really.
- Parameters
-
- Returns
The documentation for this class was generated from the following file:
- source/TestUtils/PeanutButter.TestUtils.AspNetCore/Fakes/FakeHttpResponse.cs