Interface IOkTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.OkResult or Microsoft.AspNetCore.Mvc.OkObjectResult result.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IOkTestBuilder : IBaseTestBuilderWithResponseModel, IBaseTestBuilderWithActionResult<ActionResult>, IBaseTestBuilderWithInvokedAction, IBaseTestBuilderWithAction, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceContainingContentType(MediaTypeHeaderValue)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the content type provided as MediaTypeHeaderValue.
Declaration
IAndOkTestBuilder ContainingContentType(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.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingContentType(String)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the content type provided as string.
Declaration
IAndOkTestBuilder ContainingContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingContentTypes(MediaTypeHeaderValue[])
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the same content types provided as MediaTypeHeaderValue parameters.
Declaration
IAndOkTestBuilder ContainingContentTypes(params MediaTypeHeaderValue[] contentTypes)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Net.Http.Headers.MediaTypeHeaderValue[] | contentTypes | Content types as MediaTypeHeaderValue parameters. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingContentTypes(IEnumerable<MediaTypeHeaderValue>)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the same content types provided as collection of MediaTypeHeaderValue.
Declaration
IAndOkTestBuilder ContainingContentTypes(IEnumerable<MediaTypeHeaderValue> contentTypes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Microsoft.Net.Http.Headers.MediaTypeHeaderValue> | contentTypes | Content types as collection of MediaTypeHeaderValue. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingContentTypes(IEnumerable<String>)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the same content types provided as collection of strings.
Declaration
IAndOkTestBuilder ContainingContentTypes(IEnumerable<string> contentTypes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | contentTypes | Content types as collection of strings. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingContentTypes(String[])
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the same content types provided as string parameters.
Declaration
IAndOkTestBuilder ContainingContentTypes(params string[] contentTypes)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | contentTypes | Content types as string parameters. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingOutputFormatter(IOutputFormatter)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the provided IOutputFormatter.
Declaration
IAndOkTestBuilder ContainingOutputFormatter(IOutputFormatter outputFormatter)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter | outputFormatter | Instance of IOutputFormatter. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingOutputFormatterOfType<TOutputFormatter>()
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains IOutputFormatter of the provided type.
Declaration
IAndOkTestBuilder ContainingOutputFormatterOfType<TOutputFormatter>()where TOutputFormatter : IOutputFormatter
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
Type Parameters
Name | Description |
---|---|
TOutputFormatter | Type of IOutputFormatter. |
ContainingOutputFormatters(IOutputFormatter[])
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the provided output formatters.
Declaration
IAndOkTestBuilder ContainingOutputFormatters(params IOutputFormatter[] outputFormatters)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter[] | outputFormatters | IOutputFormatter parameters. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
ContainingOutputFormatters(IEnumerable<IOutputFormatter>)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult contains the provided output formatters.
Declaration
IAndOkTestBuilder ContainingOutputFormatters(IEnumerable<IOutputFormatter> outputFormatters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter> | outputFormatters | Collection of IOutputFormatter. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
WithStatusCode(Int32)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult has the same status code as the provided one.
Declaration
IAndOkTestBuilder WithStatusCode(int statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Status code as integer. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |
WithStatusCode(HttpStatusCode)
Tests whether Microsoft.AspNetCore.Mvc.OkObjectResult has the same status code as the provided HttpStatusCode.
Declaration
IAndOkTestBuilder WithStatusCode(HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | HttpStatusCode enumeration. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder. |