Class ViewComponentShouldReturnTestBuilderExtensions
Contains extension methods for IViewComponentShouldReturnTestBuilder<TInvocationResult>.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.Helpers.dll
Syntax
public static class ViewComponentShouldReturnTestBuilderExtensions
Methods
| Improve this Doc View SourceView<TInvocationResult, TModel>(IViewComponentShouldReturnTestBuilder<TInvocationResult>, TModel)
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult with the provided deeply equal model object.
Declaration
public static IAndViewTestBuilder View<TInvocationResult, TModel>(this IViewComponentShouldReturnTestBuilder<TInvocationResult> builder, TModel model)
Parameters
Type | Name | Description |
---|---|---|
IViewComponentShouldReturnTestBuilder<TInvocationResult> | builder | Instance of IViewComponentShouldReturnTestBuilder<TInvocationResult> type. |
TModel | model | Expected model object. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder type. |
Type Parameters
Name | Description |
---|---|
TInvocationResult | Type of invocation result. |
TModel | Expected model type. |
View<TInvocationResult, TModel>(IViewComponentShouldReturnTestBuilder<TInvocationResult>, String, TModel)
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult with the provided view name and deeply equal model object.
Declaration
public static IAndViewTestBuilder View<TInvocationResult, TModel>(this IViewComponentShouldReturnTestBuilder<TInvocationResult> builder, string viewName, TModel model)
Parameters
Type | Name | Description |
---|---|---|
IViewComponentShouldReturnTestBuilder<TInvocationResult> | builder | Instance of IViewComponentShouldReturnTestBuilder<TInvocationResult> type. |
System.String | viewName | Expected view name. |
TModel | model | Expected model object. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder type. |
Type Parameters
Name | Description |
---|---|
TInvocationResult | Type of invocation result. |
TModel | Expected model type. |