Interface IShouldMapTestBuilder
Used for building and testing a route.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Routing
Assembly:MyTested.AspNetCore.Mvc.Routing.dll
Syntax
public interface IShouldMapTestBuilder : IResolvedRouteTestBuilder
Methods
| Improve this Doc View SourceTo(String, String)
Tests whether the built route is resolved to the action and controller with the provided names.
Declaration
IAndResolvedRouteTestBuilder To(string actionName, string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | actionName | Expected action name. |
System.String | controllerName | Expected controller name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
To<TController>()
Tests whether the built route is resolved to the controller of the given type.
Declaration
IAndResolvedRouteTestBuilder To<TController>()where TController : class
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
Type Parameters
Name | Description |
---|---|
TController | Type of the expected controller. |
To<TController>(Expression<Action<TController>>)
Tests whether the built route is resolved to the action provided by the expression.
Declaration
IAndResolvedRouteTestBuilder To<TController>(Expression<Action<TController>> actionCall)where TController : class
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Action<TController>> | actionCall | Method call expression indicating the expected resolved action. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
Type Parameters
Name | Description |
---|---|
TController | Type of expected resolved controller. |
To<TController>(Expression<Func<TController, Task>>)
Tests whether the built route is resolved to the asynchronous action provided by the expression.
Declaration
IAndResolvedRouteTestBuilder To<TController>(Expression<Func<TController, Task>> actionCall)where TController : class
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TController, System.Threading.Tasks.Task>> | actionCall | Method call expression indicating the expected resolved asynchronous action. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
Type Parameters
Name | Description |
---|---|
TController | Type of expected resolved controller. |
ToAction(String)
Tests whether the built route is resolved to the action with the provided name.
Declaration
IAndResolvedRouteTestBuilder ToAction(string actionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | actionName | Expected action name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
ToController(String)
Tests whether the built route is resolved to the controller with the provided name.
Declaration
IAndResolvedRouteTestBuilder ToController(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | Expected controller name. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder | The MyTested.AspNetCore.Mvc.Builders.Contracts.Routing.IAndResolvedRouteTestBuilder. |
ToNonExistingRoute()
Tests whether the built route cannot be resolved.
Declaration
void ToNonExistingRoute()