Interface IShouldReturnTestBuilder<TActionResult>
Used for testing returned action result.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Actions
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IShouldReturnTestBuilder<TActionResult> : IBaseShouldReturnTestBuilder<TActionResult, IAndTestBuilder>, IBaseShouldReturnTestBuilder<TActionResult>, IBaseShouldReturnTestBuilder
Type Parameters
Name | Description |
---|---|
TActionResult | Result from invoked action in ASP.NET Core MVC controller. |
Methods
| Improve this Doc View SourceBadRequest()
Tests whether the action result is Microsoft.AspNetCore.Mvc.BadRequestResult or Microsoft.AspNetCore.Mvc.BadRequestObjectResult.
Declaration
IAndBadRequestTestBuilder BadRequest()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.BadRequest.IAndBadRequestTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.BadRequest.IAndBadRequestTestBuilder type. |
Challenge()
Tests whether the action result is Microsoft.AspNetCore.Mvc.ChallengeResult.
Declaration
IAndChallengeTestBuilder Challenge()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Challenge.IAndChallengeTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Challenge.IAndChallengeTestBuilder type. |
Content()
Tests whether the action result is Microsoft.AspNetCore.Mvc.ContentResult.
Declaration
IAndContentTestBuilder Content()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder type. |
Content(Action<String>)
Tests whether Microsoft.AspNetCore.Mvc.ContentResult passes the given assertions.
Declaration
IAndContentTestBuilder 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.ActionResults.Content.IAndContentTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder type. |
Content(Func<String, Boolean>)
Tests whether Microsoft.AspNetCore.Mvc.ContentResult passes the given predicate.
Declaration
IAndContentTestBuilder 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.ActionResults.Content.IAndContentTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder type. |
Content(String)
Tests whether the action result is Microsoft.AspNetCore.Mvc.ContentResult with expected content.
Declaration
IAndContentTestBuilder Content(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | Expected content as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Content.IAndContentTestBuilder type. |
Created()
Tests whether the action result is Microsoft.AspNetCore.Mvc.CreatedResult,
Microsoft.AspNetCore.Mvc.CreatedAtActionResult or Microsoft.AspNetCore.Mvc.CreatedAtRouteResult.
Declaration
IAndCreatedTestBuilder Created()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Created.IAndCreatedTestBuilder type. |
Empty()
Tests whether the action result is Microsoft.AspNetCore.Mvc.EmptyResult.
Declaration
IAndTestBuilder Empty()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
File()
Tests whether the action result is Microsoft.AspNetCore.Mvc.FileStreamResult,
Microsoft.AspNetCore.Mvc.VirtualFileResult or Microsoft.AspNetCore.Mvc.FileContentResult.
Declaration
IAndFileTestBuilder File()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder type. |
Forbid()
Tests whether the action result is Microsoft.AspNetCore.Mvc.ForbidResult.
Declaration
IAndForbidTestBuilder Forbid()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Forbid.IAndForbidTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Forbid.IAndForbidTestBuilder type. |
LocalRedirect()
Tests whether the action result is Microsoft.AspNetCore.Mvc.LocalRedirectResult.
Declaration
IAndLocalRedirectTestBuilder LocalRedirect()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.LocalRedirect.IAndLocalRedirectTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.LocalRedirect.IAndLocalRedirectTestBuilder type. |
NoContent()
Tests whether the action result is Microsoft.AspNetCore.Mvc.NoContentResult.
Declaration
IAndTestBuilder NoContent()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
NotFound()
Tests whether the action result is Microsoft.AspNetCore.Mvc.NotFoundResult or Microsoft.AspNetCore.Mvc.NotFoundObjectResult.
Declaration
IAndNotFoundTestBuilder NotFound()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.NotFound.IAndNotFoundTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.NotFound.IAndNotFoundTestBuilder type. |
Object()
Tests whether the action result is Microsoft.AspNetCore.Mvc.ObjectResult.
Declaration
IAndObjectTestBuilder Object()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Object.IAndObjectTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Object.IAndObjectTestBuilder type. |
Ok()
Tests whether the action result is Microsoft.AspNetCore.Mvc.OkResult or Microsoft.AspNetCore.Mvc.OkObjectResult.
Declaration
IAndOkTestBuilder Ok()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Ok.IAndOkTestBuilder type. |
PhysicalFile()
Tests whether the action result is Microsoft.AspNetCore.Mvc.PhysicalFileResult.
Declaration
IAndPhysicalFileTestBuilder PhysicalFile()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndPhysicalFileTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndPhysicalFileTestBuilder type. |
Redirect()
Tests whether the action result is Microsoft.AspNetCore.Mvc.RedirectResult,
Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult.
Declaration
IAndRedirectTestBuilder Redirect()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder type. |
StatusCode()
Tests whether the action result is Microsoft.AspNetCore.Mvc.StatusCodeResult or Microsoft.AspNetCore.Mvc.ObjectResult.
Declaration
IAndStatusCodeTestBuilder StatusCode()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder type. |
StatusCode(Int32)
Tests whether the action result is Microsoft.AspNetCore.Mvc.StatusCodeResult or Microsoft.AspNetCore.Mvc.ObjectResult and it has the same status code as provided one.
Declaration
IAndStatusCodeTestBuilder StatusCode(int statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | statusCode | Status code as integer. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder type. |
StatusCode(HttpStatusCode)
Tests whether the action result is Microsoft.AspNetCore.Mvc.StatusCodeResult or Microsoft.AspNetCore.Mvc.ObjectResult and is the same as provided HttpStatusCode.
Declaration
IAndStatusCodeTestBuilder StatusCode(HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | HttpStatusCode enumeration. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.StatusCode.IAndStatusCodeTestBuilder type. |
Unauthorized()
Tests whether the action result is Microsoft.AspNetCore.Mvc.UnauthorizedResult.
Declaration
IAndTestBuilder Unauthorized()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |
UnsupportedMediaType()
Tests whether the action result is Microsoft.AspNetCore.Mvc.UnsupportedMediaTypeResult.
Declaration
IAndTestBuilder UnsupportedMediaType()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.And.IAndTestBuilder type. |