Interface IViewTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View
Assembly:MyTested.AspNetCore.Mvc.ViewActionResults.dll
Syntax
public interface IViewTestBuilder : IBaseTestBuilderWithResponseModel, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceWithContentType(MediaTypeHeaderValue)
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same content type as the provided MediaTypeHeaderValue.
Declaration
IAndViewTestBuilder 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.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
WithContentType(String)
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same content type as the provided string.
Declaration
IAndViewTestBuilder WithContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
WithStatusCode(Int32)
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same status code as the provided one.
Declaration
IAndViewTestBuilder WithStatusCode(int statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Status code as integer. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
WithStatusCode(HttpStatusCode)
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same status code as the provided HttpStatusCode.
Declaration
IAndViewTestBuilder WithStatusCode(HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | HttpStatusCode enumeration. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
WithViewEngine(IViewEngine)
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same IViewEngine as the provided one.
Declaration
IAndViewTestBuilder 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.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
WithViewEngineOfType<TViewEngine>()
Tests whether Microsoft.AspNetCore.Mvc.ViewResult or Microsoft.AspNetCore.Mvc.PartialViewResult has the same IViewEngine type as the provided one.
Declaration
IAndViewTestBuilder WithViewEngineOfType<TViewEngine>()where TViewEngine : IViewEngine
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.View.IAndViewTestBuilder. |
Type Parameters
Name | Description |
---|---|
TViewEngine | View engine of type IViewEngine. |