Interface IViewComponentShouldReturnTestBuilder<TInvocationResult>
Used for testing returned view component result.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Invocations
Assembly:MyTested.AspNetCore.Mvc.ViewComponents.dll
Syntax
public interface IViewComponentShouldReturnTestBuilder<TInvocationResult> : IBaseShouldReturnTestBuilder<TInvocationResult, IAndTestBuilder>, IBaseShouldReturnTestBuilder<TInvocationResult>, IBaseShouldReturnTestBuilder
Type Parameters
Name | Description |
---|---|
TInvocationResult | Result from invoked view component in ASP.NET Core MVC. |
Methods
| Improve this Doc View SourceContent()
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ContentViewComponentResult.
Declaration
IAndTestBuilder Content()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
Content(Action<String>)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponents.ContentViewComponentResult passes the given assertions.
Declaration
IAndTestBuilder Content(Action<string> assertions)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String> | assertions | Action containing all assertions on the content. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
Content(Func<String, Boolean>)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponents.ContentViewComponentResult passes the given predicate.
Declaration
IAndTestBuilder Content(Func<string, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Boolean> | predicate | Predicate testing the content. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
Content(String)
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ContentViewComponentResult with expected content.
Declaration
IAndTestBuilder Content(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | Expected content as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
HtmlContent()
Tests whether the view component result is Microsoft.AspNetCore.Html.IHtmlContent.
Declaration
IAndTestBuilder HtmlContent()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
HtmlContent(Action<String>)
Tests whether Microsoft.AspNetCore.Html.IHtmlContent passes the given assertions.
Declaration
IAndTestBuilder HtmlContent(Action<string> assertions)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String> | assertions | Action containing all assertions on the HTML content. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
HtmlContent(Func<String, Boolean>)
Tests whether Microsoft.AspNetCore.Html.IHtmlContent passes the given predicate.
Declaration
IAndTestBuilder HtmlContent(Func<string, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Boolean> | predicate | Predicate testing the HTML content. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
HtmlContent(String)
Tests whether the view component result is Microsoft.AspNetCore.Html.IHtmlContent with expected content.
Declaration
IAndTestBuilder HtmlContent(string htmlContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | htmlContent | Expected HTML content as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
View()
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult with the default view name.
Declaration
IAndViewTestBuilder View()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder type. |
View(String)
Tests whether the view component result is Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult with the provided view name.
Declaration
IAndViewTestBuilder View(string viewName)
Parameters
Type | Name | Description |
---|---|---|
System.String | viewName | Expected view name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponentResults.IAndViewTestBuilder type. |