Interface IRedirectTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.RedirectResult, Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IRedirectTestBuilder : IBaseTestBuilderWithActionResult<ActionResult>, IBaseTestBuilderWithInvokedAction, IBaseTestBuilderWithAction, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceContainingRouteKey(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains specific route key.
Declaration
IAndRedirectTestBuilder ContainingRouteKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Expected route key. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ContainingRouteValue(String, Object)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains specific route key and value.
Declaration
IAndRedirectTestBuilder 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.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ContainingRouteValue<TRouteValue>(TRouteValue)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains specific route value.
Declaration
IAndRedirectTestBuilder ContainingRouteValue<TRouteValue>(TRouteValue value)
Parameters
Type | Name | Description |
---|---|---|
TRouteValue | value | Expected route value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Type of the route value. |
ContainingRouteValueOfType<TRouteValue>()
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains specific route value of the given type.
Declaration
IAndRedirectTestBuilder ContainingRouteValueOfType<TRouteValue>()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Expected type of the route value. |
ContainingRouteValueOfType<TRouteValue>(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains specific route value of the given type with the provided key.
Declaration
IAndRedirectTestBuilder ContainingRouteValueOfType<TRouteValue>(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Expected route key. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
Type Parameters
Name | Description |
---|---|
TRouteValue | Expected type of the route value. |
ContainingRouteValues(IDictionary<String, Object>)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains the provided route values.
Declaration
IAndRedirectTestBuilder 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.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ContainingRouteValues(Object)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult contains the provided route values.
Declaration
IAndRedirectTestBuilder ContainingRouteValues(object routeValues)
Parameters
Type | Name | Description |
---|---|---|
System.Object | routeValues | Expected route value dictionary. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
Permanent()
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult, Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult is permanent.
Declaration
IAndRedirectTestBuilder Permanent()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToAction(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult has specific action name.
Declaration
IAndRedirectTestBuilder ToAction(string actionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | actionName | Expected action name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToController(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult result has specific controller name.
Declaration
IAndRedirectTestBuilder ToController(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | Expected controller name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToUrl(Action<IUriTestBuilder>)
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult has specific location provided by builder.
Declaration
IAndRedirectTestBuilder ToUrl(Action<IUriTestBuilder> uriTestBuilder)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IUriTestBuilder> | uriTestBuilder | Builder for expected URI. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToUrl(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult has specific location provided by string.
Declaration
IAndRedirectTestBuilder ToUrl(string location)
Parameters
Type | Name | Description |
---|---|---|
System.String | location | Expected location as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToUrl(Uri)
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult has specific location provided by Uri.
Declaration
IAndRedirectTestBuilder ToUrl(Uri location)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | location | Expected location as Uri. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToUrlPassing(Action<String>)
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult location passes the given assertions.
Declaration
IAndRedirectTestBuilder ToUrlPassing(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.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
ToUrlPassing(Func<String, Boolean>)
Tests whether Microsoft.AspNetCore.Mvc.RedirectResult location passes the given predicate.
Declaration
IAndRedirectTestBuilder ToUrlPassing(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.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
WithRouteName(String)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToRouteResult result has specific route name.
Declaration
IAndRedirectTestBuilder WithRouteName(string routeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | routeName | Expected route name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
WithUrlHelper(IUrlHelper)
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult has the same IUrlHelper as the provided one.
Declaration
IAndRedirectTestBuilder 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.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
WithUrlHelperOfType<TUrlHelper>()
Tests whether Microsoft.AspNetCore.Mvc.RedirectToActionResult or Microsoft.AspNetCore.Mvc.RedirectToRouteResult has the same IUrlHelper type as the provided one.
Declaration
IAndRedirectTestBuilder WithUrlHelperOfType<TUrlHelper>()where TUrlHelper : IUrlHelper
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Redirect.IAndRedirectTestBuilder. |
Type Parameters
Name | Description |
---|---|
TUrlHelper | URL helper of type IUrlHelper. |