MY TESTED ASP.NET CORE MVC DOCS
Show / Hide Table of Contents

Interface IControllerBuilder<TController>

Used for building the controller which will be tested.

Inherited Members
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Action<TComponent>)
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Func<TComponent, Boolean>)
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IControllerBuilder<TController> : IBaseTestBuilderWithComponentBuilder<IAndControllerBuilder<TController>>, IBaseTestBuilderWithComponent, IBaseTestBuilder where TController : class
Type Parameters
Name Description
TController Class representing ASP.NET Core MVC controller.

Methods

| Improve this Doc View Source

Calling(Expression<Action<TController>>)

Indicates which action should be invoked and tested.

Declaration
IVoidActionResultTestBuilder Calling(Expression<Action<TController>> actionCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Action<TController>> actionCall

Method call expression indicating invoked void action.

Returns
Type Description
IVoidActionResultTestBuilder

Test builder of IActionResultTestBuilder<TActionResult> type.

| Improve this Doc View Source

Calling(Expression<Func<TController, Task>>)

Indicates which action should be invoked and tested.

Declaration
IVoidActionResultTestBuilder Calling(Expression<Func<TController, Task>> actionCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TController, System.Threading.Tasks.Task>> actionCall

Method call expression indicating invoked asynchronous void action.

Returns
Type Description
IVoidActionResultTestBuilder

Test builder of IActionResultTestBuilder<TActionResult> type.

| Improve this Doc View Source

Calling<TActionResult>(Expression<Func<TController, TActionResult>>)

Indicates which action should be invoked and tested.

Declaration
IActionResultTestBuilder<TActionResult> Calling<TActionResult>(Expression<Func<TController, TActionResult>> actionCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TController, TActionResult>> actionCall

Method call expression indicating invoked action.

Returns
Type Description
IActionResultTestBuilder<TActionResult>

Test builder of IActionResultTestBuilder<TActionResult> type.

Type Parameters
Name Description
TActionResult Type of result from action.
| Improve this Doc View Source

Calling<TActionResult>(Expression<Func<TController, Task<TActionResult>>>)

Indicates which action should be invoked and tested.

Declaration
IActionResultTestBuilder<TActionResult> Calling<TActionResult>(Expression<Func<TController, Task<TActionResult>>> actionCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TController, System.Threading.Tasks.Task<TActionResult>>> actionCall

Method call expression indicating invoked asynchronous action.

Returns
Type Description
IActionResultTestBuilder<TActionResult>

Test builder of IActionResultTestBuilder<TActionResult> type.

Type Parameters
Name Description
TActionResult Type of result from action.
| Improve this Doc View Source

ShouldHave()

Used for testing controller additional details.

Declaration
IControllerTestBuilder ShouldHave()
Returns
Type Description
IControllerTestBuilder

Test builder of IControllerTestBuilder type.

| Improve this Doc View Source

WithActionContext(ActionContext)

Sets the ActionContext on the tested controller.

Declaration
IAndControllerBuilder<TController> WithActionContext(ActionContext actionContext)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.ActionContext actionContext

Instance of ActionContext to set.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers.IAndControllerBuilder<TController>

The same IControllerBuilder<TController>.

| Improve this Doc View Source

WithActionContext(Action<ActionContext>)

Sets the ActionContext on the tested controller.

Declaration
IAndControllerBuilder<TController> WithActionContext(Action<ActionContext> actionContextSetup)
Parameters
Type Name Description
System.Action<Microsoft.AspNetCore.Mvc.ActionContext> actionContextSetup

Action setting the ActionContext.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers.IAndControllerBuilder<TController>

The same IControllerBuilder<TController>.

| Improve this Doc View Source

WithControllerContext(ControllerContext)

Sets the ControllerContext on the tested controller.

Declaration
IAndControllerBuilder<TController> WithControllerContext(ControllerContext controllerContext)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.ControllerContext controllerContext

Instance of ControllerContext to set.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers.IAndControllerBuilder<TController>

The same IControllerBuilder<TController>.

| Improve this Doc View Source

WithControllerContext(Action<ControllerContext>)

Sets the ControllerContext on the tested controller.

Declaration
IAndControllerBuilder<TController> WithControllerContext(Action<ControllerContext> controllerContextSetup)
Parameters
Type Name Description
System.Action<Microsoft.AspNetCore.Mvc.ControllerContext> controllerContextSetup

Action setting the ControllerContext.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers.IAndControllerBuilder<TController>

The same IControllerBuilder<TController>.

| Improve this Doc View Source

WithSetup(Action<TController>)

Sets custom properties to the controller using a delegate.

Declaration
IAndControllerBuilder<TController> WithSetup(Action<TController> controllerSetup)
Parameters
Type Name Description
System.Action<TController> controllerSetup

Action to use for controller setup.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.Controllers.IAndControllerBuilder<TController>

The same IControllerBuilder<TController>.

Extension Methods

ComponentBuilderSessionExtensions.WithSession<IAndControllerBuilder<TController>>(Action<ISessionBuilder>)
ComponentBuilderDependencyInjectionExtensions.WithServices<IAndControllerBuilder<TController>>(Action<IServicesBuilder>)
ComponentBuilderDependencyInjectionExtensions.WithServices<IAndControllerBuilder<TController>>(IEnumerable<Object>)
ComponentBuilderDependencyInjectionExtensions.WithServices<IAndControllerBuilder<TController>>(Object[])
ComponentBuilderHttpExtensions.WithHttpContext<IAndControllerBuilder<TController>>(HttpContext)
ComponentBuilderHttpExtensions.WithHttpContext<IAndControllerBuilder<TController>>(Action<HttpContext>)
ComponentBuilderHttpExtensions.WithHttpRequest<IAndControllerBuilder<TController>>(HttpRequest)
ComponentBuilderHttpExtensions.WithHttpRequest<IAndControllerBuilder<TController>>(Action<IHttpRequestBuilder>)
ComponentBuilderCachingExtensions.WithMemoryCache<IAndControllerBuilder<TController>>(Action<IMemoryCacheBuilder>)
ComponentBuilderOptionsExtensions.WithOptions<IAndControllerBuilder<TController>>(Action<IOptionsBuilder>)
ComponentBuilderRoutingExtensions.WithRouteData<IAndControllerBuilder<TController>>()
ComponentBuilderRoutingExtensions.WithRouteData<IAndControllerBuilder<TController>>(Object)
ComponentBuilderAuthenticationExtensions.WithAuthenticatedUser<IAndControllerBuilder<TController>>()
ComponentBuilderAuthenticationExtensions.WithAuthenticatedUser<IAndControllerBuilder<TController>>(Action<IClaimsPrincipalBuilder>)
ComponentBuilderEntityFrameworkCoreExtensions.WithDbContext<IAndControllerBuilder<TController>>(Action<IDbContextBuilder>)
ControllerBuilderDataAnnotationsExtensions.WithoutValidation<TController>()
ComponentBuilderTempDataExtensions.WithTempData<IAndControllerBuilder<TController>>(Action<ITempDataBuilder>)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 MyTestedASP.NET. All Rights Reserved. Generated by DocFX