Interface ICreatedTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface ICreatedTestBuilder : IBaseTestBuilderWithResponseModel, IBaseTestBuilderWithActionResult<ObjectResult>, IBaseTestBuilderWithInvokedAction, IBaseTestBuilderWithAction, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceAtAction(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult has specific action name.
Declaration
IAndCreatedTestBuilder AtAction(string actionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | actionName | Expected action name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtController(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult has specific controller name.
Declaration
IAndCreatedTestBuilder AtController(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | Expected controller name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtLocation(Action<IUriTestBuilder>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult has specific location provided by builder.
Declaration
IAndCreatedTestBuilder AtLocation(Action<IUriTestBuilder> uriTestBuilder)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IUriTestBuilder> | uriTestBuilder | Builder for expected URI. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtLocation(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult has specific location provided by string.
Declaration
IAndCreatedTestBuilder AtLocation(string location)
Parameters
Type | Name | Description |
---|---|---|
System.String | location | Expected location as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtLocation(Uri)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult has specific location provided by Uri.
Declaration
IAndCreatedTestBuilder AtLocation(Uri location)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | location | Expected location as Uri. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtLocationPassing(Action<String>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult location passes the given assertions.
Declaration
IAndCreatedTestBuilder AtLocationPassing(Action<string> assertions)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String> | assertions | Action containing all assertions on the location. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
AtLocationPassing(Func<String, Boolean>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult location passes the given predicate.
Declaration
IAndCreatedTestBuilder AtLocationPassing(Func<string, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Boolean> | predicate | Predicate testing the location. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentType(MediaTypeHeaderValue)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the content type provided as MediaTypeHeaderValue.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentType(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the content type provided as string.
Declaration
IAndCreatedTestBuilder ContainingContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentTypes(MediaTypeHeaderValue[])
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the same content types provided as MediaTypeHeaderValue parameters.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentTypes(IEnumerable<MediaTypeHeaderValue>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the same content types provided as collection of MediaTypeHeaderValue.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentTypes(IEnumerable<String>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the same content types provided as collection of strings.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingContentTypes(String[])
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the same content types provided as string parameters.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingOutputFormatter(IOutputFormatter)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the provided output formatter.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingOutputFormatterOfType<TOutputFormatter>()
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains output formatter of the provided type.
Declaration
IAndCreatedTestBuilder ContainingOutputFormatterOfType<TOutputFormatter>()where TOutputFormatter : IOutputFormatter
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
Type Parameters
Name | Description |
---|---|
TOutputFormatter | Type of IOutputFormatter. |
ContainingOutputFormatters(IOutputFormatter[])
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the provided output formatters.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingOutputFormatters(IEnumerable<IOutputFormatter>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the provided output formatters.
Declaration
IAndCreatedTestBuilder 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.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingRouteKey(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains specific route key.
Declaration
IAndCreatedTestBuilder ContainingRouteKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Expected route key. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingRouteValue(String, Object)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains specific route key and value.
Declaration
IAndCreatedTestBuilder ContainingRouteValue(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Expected route key. |
System.Object | value | Expected route value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingRouteValue<TRouteValue>(TRouteValue)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains specific route value.
Declaration
IAndCreatedTestBuilder ContainingRouteValue<TRouteValue>(TRouteValue value)
Parameters
Type | Name | Description |
---|---|---|
TRouteValue | value | Expected route value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Type of the route value. |
ContainingRouteValueOfType<TRouteValue>()
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains specific route value of the given type.
Declaration
IAndCreatedTestBuilder ContainingRouteValueOfType<TRouteValue>()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Expected type of the route value. |
ContainingRouteValueOfType<TRouteValue>(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains specific route value of the given type with the provided key.
Declaration
IAndCreatedTestBuilder ContainingRouteValueOfType<TRouteValue>(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Expected route key. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Expected type of the route value. |
ContainingRouteValues(IDictionary<String, Object>)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the provided route values.
Declaration
IAndCreatedTestBuilder ContainingRouteValues(IDictionary<string, object> routeValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | routeValues | Expected route value dictionary. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
ContainingRouteValues(Object)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult contains the provided route values.
Declaration
IAndCreatedTestBuilder ContainingRouteValues(object routeValues)
Parameters
Type | Name | Description |
---|---|---|
System.Object | routeValues | Expected route value dictionary. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
WithRouteName(String)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtRouteResult has specific route name.
Declaration
IAndCreatedTestBuilder WithRouteName(string routeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | routeName | Expected route name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
WithStatusCode(Int32)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult has the same status code as the provided one.
Declaration
IAndCreatedTestBuilder WithStatusCode(int statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Status code as integer. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
WithStatusCode(HttpStatusCode)
Tests whether Microsoft.AspNetCore.Mvc.CreatedResult, Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult has the same status code as the provided HttpStatusCode.
Declaration
IAndCreatedTestBuilder WithStatusCode(HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | HttpStatusCode enumeration. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
WithUrlHelper(IUrlHelper)
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult has the same URL helper as the provided one.
Declaration
IAndCreatedTestBuilder WithUrlHelper(IUrlHelper urlHelper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.IUrlHelper | urlHelper | URL helper of type IUrlHelper. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
WithUrlHelperOfType<TUrlHelper>()
Tests whether Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult has the same URL helper type as the provided one.
Declaration
IAndCreatedTestBuilder WithUrlHelperOfType<TUrlHelper>()where TUrlHelper : IUrlHelper
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder. |
Type Parameters
Name | Description |
---|---|
TUrlHelper | URL helper of type IUrlHelper. |