Sets up the useful bits for testing an asp.net middleware class - use this to easily set up the context and next parameters for InvokeAsync.
More...
|
|
const string | METADATA_KEY_CALL_ARGS = "__callargs__" |
| | The key used to hold the call history for the delegate in PB metadata.
|
|
|
RequestDelegate | Delegate [get] |
| | The delegate that is generated for your test.
|
|
HttpContext | HttpContext [get, set] |
| | The HttpContext (or use this to set your own).
|
Sets up the useful bits for testing an asp.net middleware class - use this to easily set up the context and next parameters for InvokeAsync.
◆ RequestDelegateTestArena() [1/5]
| PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.RequestDelegateTestArena |
( |
Action< HttpContext > | delegateLogic | ) |
|
Create the test arena with custom delegate logic and no http context mutations.
- Parameters
-
◆ RequestDelegateTestArena() [2/5]
| PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.RequestDelegateTestArena |
( |
Func< HttpContext, Task > | delegateLogic | ) |
|
Create the test arena with custom delegate logic and no http context mutations.
- Parameters
-
◆ RequestDelegateTestArena() [3/5]
| PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.RequestDelegateTestArena |
( |
Action< HttpContext > | logic, |
|
|
Action< HttpContextBuilder > | httpContextMutator ) |
◆ RequestDelegateTestArena() [4/5]
| PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.RequestDelegateTestArena |
( |
Func< HttpContext, Task > | logic, |
|
|
Action< HttpContextBuilder > | httpContextMutator ) |
Create the test arena with the provided delegate logic and http context mutations.
- Parameters
-
◆ RequestDelegateTestArena() [5/5]
| PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.RequestDelegateTestArena |
( |
Func< HttpContext, Task > | logic, |
|
|
HttpContext | httpContext ) |
Construct with the provided logic and context.
- Parameters
-
- Exceptions
-
◆ Deconstruct()
| void PeanutButter.TestUtils.AspNetCore.Utils.RequestDelegateTestArena.Deconstruct |
( |
out HttpContext | ctx, |
|
|
out RequestDelegate | next ) |
Deconstruct into a tuple, eg var (ctx, next) = new RequestDelegateTestArena();.
- Parameters
-
The documentation for this class was generated from the following file:
- source/TestUtils/PeanutButter.TestUtils.AspNetCore/Utils/RequestDelegateTestArena.cs