Class MyMvc
Provides methods to specify an ASP.NET Core MVC test case.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.dll
Syntax
public static class MyMvc
Methods
| Improve this Doc View SourceController<TController>()
Starts a controller test.
Declaration
public static IControllerBuilder<TController> Controller<TController>()where TController : class
Returns
Type | Description |
---|---|
IControllerBuilder<TController> | Test builder of IControllerBuilder<TController> type. |
Type Parameters
Name | Description |
---|---|
TController | Class representing ASP.NET Core MVC controller. |
Controller<TController>(TController)
Starts a controller test.
Declaration
public static IControllerBuilder<TController> Controller<TController>(TController controller)where TController : class
Parameters
Type | Name | Description |
---|---|---|
TController | controller | Instance of the ASP.NET Core MVC controller to test. |
Returns
Type | Description |
---|---|
IControllerBuilder<TController> | Test builder of IControllerBuilder<TController> type. |
Type Parameters
Name | Description |
---|---|
TController | Class representing ASP.NET Core MVC controller. |
Controller<TController>(Func<TController>)
Starts a controller test.
Declaration
public static IControllerBuilder<TController> Controller<TController>(Func<TController> construction)where TController : class
Parameters
Type | Name | Description |
---|---|---|
System.Func<TController> | construction | Construction function returning the instantiated controller. |
Returns
Type | Description |
---|---|
IControllerBuilder<TController> | Test builder of IControllerBuilder<TController> type. |
Type Parameters
Name | Description |
---|---|
TController | Class representing ASP.NET Core MVC controller. |
Routing()
Starts a route test.
Declaration
public static IRouteTestBuilder Routing()
Returns
Type | Description |
---|---|
IRouteTestBuilder | Test builder of IRouteTestBuilder type. |
StartsFrom<TStartup>()
Configures the tested application with the provided startup class.
Declaration
public static IApplicationConfigurationBuilder StartsFrom<TStartup>()where TStartup : class
Returns
Type | Description |
---|---|
IApplicationConfigurationBuilder | Builder of IApplicationConfigurationBuilder type. |
Type Parameters
Name | Description |
---|---|
TStartup | Type of startup class. |
ViewComponent<TViewComponent>()
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> ViewComponent<TViewComponent>()where TViewComponent : class
Returns
Type | Description |
---|---|
IViewComponentBuilder<TViewComponent> | Test builder of IViewComponentBuilder<TViewComponent> type. |
Type Parameters
Name | Description |
---|---|
TViewComponent | Class representing ASP.NET Core MVC view component. |
ViewComponent<TViewComponent>(TViewComponent)
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> ViewComponent<TViewComponent>(TViewComponent viewComponent)where TViewComponent : class
Parameters
Type | Name | Description |
---|---|---|
TViewComponent | viewComponent | Instance of the ASP.NET Core MVC view component to use. |
Returns
Type | Description |
---|---|
IViewComponentBuilder<TViewComponent> | Test builder of IViewComponentBuilder<TViewComponent> type. |
Type Parameters
Name | Description |
---|---|
TViewComponent | Class representing ASP.NET Core MVC view component. |
ViewComponent<TViewComponent>(Func<TViewComponent>)
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> ViewComponent<TViewComponent>(Func<TViewComponent> construction)where TViewComponent : class
Parameters
Type | Name | Description |
---|---|---|
System.Func<TViewComponent> | construction | Construction function returning the instantiated view component. |
Returns
Type | Description |
---|---|
IViewComponentBuilder<TViewComponent> | Test builder of IViewComponentBuilder<TViewComponent> type. |
Type Parameters
Name | Description |
---|---|
TViewComponent | Class representing ASP.NET Core MVC view component. |