Class MyViewComponent<TViewComponent>
Provides methods to specify an ASP.NET Core MVC view component test case.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.ViewComponents.dll
Syntax
public class MyViewComponent<TViewComponent> : ViewComponentBuilder<TViewComponent>, IAndViewComponentBuilder<TViewComponent>, IViewComponentBuilder<TViewComponent>, IBaseTestBuilderWithComponentBuilder<IAndViewComponentBuilder<TViewComponent>>, IBaseTestBuilderWithComponent, IBaseTestBuilder where TViewComponent : class
Type Parameters
Name | Description |
---|---|
TViewComponent | Type of ASP.NET Core MVC view component to test. |
Constructors
| Improve this Doc View SourceMyViewComponent()
Initializes a new instance of the MyViewComponent<TViewComponent> class.
Declaration
public MyViewComponent()
MyViewComponent(TViewComponent)
Initializes a new instance of the MyViewComponent<TViewComponent> class.
Declaration
public MyViewComponent(TViewComponent viewComponent)
Parameters
Type | Name | Description |
---|---|---|
TViewComponent | viewComponent | Instance of the ASP.NET Core MVC view component to test. |
MyViewComponent(Func<TViewComponent>)
Initializes a new instance of the MyViewComponent<TViewComponent> class.
Declaration
public MyViewComponent(Func<TViewComponent> construction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TViewComponent> | construction | Construction function returning the instantiated view component. |
Methods
| Improve this Doc View SourceInstance()
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> Instance()
Returns
Type | Description |
---|---|
IViewComponentBuilder<TViewComponent> | Test builder of IViewComponentBuilder<TViewComponent> type. |
Instance(TViewComponent)
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> Instance(TViewComponent viewComponent)
Parameters
Type | Name | Description |
---|---|---|
TViewComponent | viewComponent | Instance of the ASP.NET Core MVC view component to test. |
Returns
Type | Description |
---|---|
IViewComponentBuilder<TViewComponent> | Test builder of IViewComponentBuilder<TViewComponent> type. |
Instance(Func<TViewComponent>)
Starts a view component test.
Declaration
public static IViewComponentBuilder<TViewComponent> Instance(Func<TViewComponent> construction)
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. |