Interface IViewComponentTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.ViewComponentResult.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View
Assembly:MyTested.AspNetCore.Mvc.ViewActionResults.dll
Syntax
public interface IViewComponentTestBuilder : IBaseTestBuilderWithResponseModel, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceContainingArgument(String, Object)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with an argument deeply equal to the provided one.
Declaration
IAndViewComponentTestBuilder ContainingArgument(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the argument. |
System.Object | value | Expected argument value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
ContainingArgument<TArgument>(TArgument)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with an argument equal to the provided one.
Declaration
IAndViewComponentTestBuilder ContainingArgument<TArgument>(TArgument argument)
Parameters
Type | Name | Description |
---|---|---|
TArgument | argument | Argument object. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
Type Parameters
Name | Description |
---|---|
TArgument | Type of the argument. |
ContainingArgumentOfType<TArgument>()
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with an argument of the provided type.
Declaration
IAndViewComponentTestBuilder ContainingArgumentOfType<TArgument>()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
Type Parameters
Name | Description |
---|---|
TArgument | Type of the argument. |
ContainingArgumentOfType<TArgument>(String)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with an argument of the provided type and the given name.
Declaration
IAndViewComponentTestBuilder ContainingArgumentOfType<TArgument>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the argument. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
Type Parameters
Name | Description |
---|---|
TArgument | Type of the argument. |
ContainingArguments(IDictionary<String, Object>)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with the provided arguments.
Declaration
IAndViewComponentTestBuilder ContainingArguments(IDictionary<string, object> arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | arguments | Argument objects as dictionary. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
ContainingArguments(Object)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with the provided arguments.
Declaration
IAndViewComponentTestBuilder ContainingArguments(object arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Object | arguments | Arguments object. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
ContainingArgumentWithName(String)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult will be invoked with an argument with the same name as the provided one.
Declaration
IAndViewComponentTestBuilder ContainingArgumentWithName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the argument. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithContentType(MediaTypeHeaderValue)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same content type as the provided MediaTypeHeaderValue.
Declaration
IAndViewComponentTestBuilder WithContentType(MediaTypeHeaderValue contentType)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Net.Http.Headers.MediaTypeHeaderValue | contentType | Content type as MediaTypeHeaderValue. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithContentType(String)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same content type as the provided string.
Declaration
IAndViewComponentTestBuilder WithContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithStatusCode(Int32)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same status code as the provided one.
Declaration
IAndViewComponentTestBuilder WithStatusCode(int statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Status code as integer. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithStatusCode(HttpStatusCode)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same status code as the provided HttpStatusCode.
Declaration
IAndViewComponentTestBuilder WithStatusCode(HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | HttpStatusCode enumeration. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithViewEngine(IViewEngine)
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same IViewEngine as the provided one.
Declaration
IAndViewComponentTestBuilder WithViewEngine(IViewEngine viewEngine)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine | viewEngine | View engine of type IViewEngine. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
WithViewEngineOfType<TViewEngine>()
Tests whether Microsoft.AspNetCore.Mvc.ViewComponentResult has the same IViewEngine type as the provided one.
Declaration
IAndViewComponentTestBuilder WithViewEngineOfType<TViewEngine>()where TViewEngine : IViewEngine
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewComponentTestBuilder. |
Type Parameters
Name | Description |
---|---|
TViewEngine | View engine of type IViewEngine. |