Class ComponentBuilderHttpExtensions
Contains HTTP extension methods for IBaseTestBuilderWithComponentBuilder<TBuilder>.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.Http.dll
Syntax
public static class ComponentBuilderHttpExtensions
Methods
| Improve this Doc View SourceWithHttpContext<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, HttpContext)
Sets the HttpContext on the tested component.
Declaration
public static TBuilder WithHttpContext<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, HttpContext httpContext)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
Microsoft.AspNetCore.Http.HttpContext | httpContext | Instance of HttpContext to set. |
Returns
Type | Description |
---|---|
TBuilder | The same component builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |
WithHttpContext<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, Action<HttpContext>)
Sets the HttpContext on the tested component.
Declaration
public static TBuilder WithHttpContext<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, Action<HttpContext> httpContextSetup)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
System.Action<Microsoft.AspNetCore.Http.HttpContext> | httpContextSetup | Action setting the HttpContext. |
Returns
Type | Description |
---|---|
TBuilder | The same component builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |
WithHttpRequest<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, HttpRequest)
Sets the HttpRequest on the tested component.
Declaration
public static TBuilder WithHttpRequest<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, HttpRequest httpRequest)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
Microsoft.AspNetCore.Http.HttpRequest | httpRequest | Instance of HttpRequest to set. |
Returns
Type | Description |
---|---|
TBuilder | The same component builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |
WithHttpRequest<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, Action<IHttpRequestBuilder>)
Sets the HttpRequest on the tested controller.
Declaration
public static TBuilder WithHttpRequest<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, Action<IHttpRequestBuilder> httpRequestBuilder)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
System.Action<IHttpRequestBuilder> | httpRequestBuilder | Action setting the HttpRequest by using IHttpRequestBuilder. |
Returns
Type | Description |
---|---|
TBuilder | The same component builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |