RequestCounter Class
Tracks the number of requests made to the mock server and individual endpoints.
public sealed class RequestCounterConstructors
| Name | Description |
|---|---|
| RequestCounter(IHttpContextAccessor) | Tracks the number of requests made to the mock server and individual endpoints. |
RequestCounter(IHttpContextAccessor)
RequestCounter.csTracks the number of requests made to the mock server and individual endpoints.
public RequestCounter(IHttpContextAccessor httpContextAccessor)Parameters
httpContextAccessorIHttpContextAccessor
Properties
| Name | Description |
|---|---|
| TotalCount | Gets the total number of requests made to the mock server. |
TotalCount
RequestCounter.csMethods
| Name | Description |
|---|---|
| Get() | Gets the number of requests made to the current endpoint. |
| Get(Endpoint?) | Gets the number of requests made to the specified endpoint. |
| Get(HttpContext) | Gets the number of requests made to the endpoint associated with the specified HttpContext. |
Get overloads
Get()
RequestCounter.csGet(Endpoint?)
RequestCounter.csGet(HttpContext)
RequestCounter.csGets the number of requests made to the endpoint associated with the specified HttpContext.
public long Get(HttpContext httpContext)Parameters
httpContextHttpContext- The HTTP context containing the endpoint.
Returns
long The number of requests made to the endpoint.