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

Interface IViewComponentBuilder<TViewComponent>

Used for building the view component which will be tested.

Inherited Members
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Action<TComponent>)
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Func<TComponent, Boolean>)
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents
Assembly:MyTested.AspNetCore.Mvc.ViewComponents.dll
Syntax
public interface IViewComponentBuilder<TViewComponent> : IBaseTestBuilderWithComponentBuilder<IAndViewComponentBuilder<TViewComponent>>, IBaseTestBuilderWithComponent, IBaseTestBuilder where TViewComponent : class
Type Parameters
Name Description
TViewComponent Class representing ASP.NET Core MVC view component.

Methods

| Improve this Doc View Source

InvokedWith<TInvocationResult>(Expression<Func<TViewComponent, TInvocationResult>>)

Indicates which view component method should be invoked and tested.

Declaration
IViewComponentResultTestBuilder<TInvocationResult> InvokedWith<TInvocationResult>(Expression<Func<TViewComponent, TInvocationResult>> invocationCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TViewComponent, TInvocationResult>> invocationCall

Method call expression indicating invoked method.

Returns
Type Description
IViewComponentResultTestBuilder<TInvocationResult>

Test builder of IViewComponentResultTestBuilder<TInvocationResult> type.

Type Parameters
Name Description
TInvocationResult Type of result from the invocation.
| Improve this Doc View Source

InvokedWith<TInvocationResult>(Expression<Func<TViewComponent, Task<TInvocationResult>>>)

Indicates which view component method should be invoked and tested.

Declaration
IViewComponentResultTestBuilder<TInvocationResult> InvokedWith<TInvocationResult>(Expression<Func<TViewComponent, Task<TInvocationResult>>> invocationCall)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TViewComponent, System.Threading.Tasks.Task<TInvocationResult>>> invocationCall

Method call expression indicating invoked asynchronous method.

Returns
Type Description
IViewComponentResultTestBuilder<TInvocationResult>

Test builder of IViewComponentResultTestBuilder<TInvocationResult> type.

Type Parameters
Name Description
TInvocationResult Type of result from the invocation.
| Improve this Doc View Source

ShouldHave()

Used for testing view component additional details.

Declaration
IViewComponentTestBuilder ShouldHave()
Returns
Type Description
IViewComponentTestBuilder

Test builder of IViewComponentTestBuilder type.

| Improve this Doc View Source

WithActionContext(ActionContext)

Sets the ActionContext on the tested view component.

Declaration
IAndViewComponentBuilder<TViewComponent> 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.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithActionContext(Action<ActionContext>)

Sets the ActionContext on the tested controller.

Declaration
IAndViewComponentBuilder<TViewComponent> 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.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithSetup(Action<TViewComponent>)

Sets custom properties to the view component using a delegate.

Declaration
IAndViewComponentBuilder<TViewComponent> WithSetup(Action<TViewComponent> viewComponentSetup)
Parameters
Type Name Description
System.Action<TViewComponent> viewComponentSetup

Action to use for view component setup.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithViewComponentContext(ViewComponentContext)

Sets the ViewComponentContext on the tested view component.

Declaration
IAndViewComponentBuilder<TViewComponent> WithViewComponentContext(ViewComponentContext viewComponentContext)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext viewComponentContext

Instance of ViewComponentContext to set.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithViewComponentContext(Action<ViewComponentContext>)

Sets the ViewComponentContext on the tested controller.

Declaration
IAndViewComponentBuilder<TViewComponent> WithViewComponentContext(Action<ViewComponentContext> viewComponentContextSetup)
Parameters
Type Name Description
System.Action<Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext> viewComponentContextSetup

Action setting the ViewComponentContext.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithViewContext(ViewContext)

Sets the ViewContext on the tested view component.

Declaration
IAndViewComponentBuilder<TViewComponent> WithViewContext(ViewContext viewContext)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext

Instance of ViewContext to set.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

| Improve this Doc View Source

WithViewContext(Action<ViewContext>)

Sets the ViewContext on the tested controller.

Declaration
IAndViewComponentBuilder<TViewComponent> WithViewContext(Action<ViewContext> viewContextSetup)
Parameters
Type Name Description
System.Action<Microsoft.AspNetCore.Mvc.Rendering.ViewContext> viewContextSetup

Action setting the ViewContext.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ViewComponents.IAndViewComponentBuilder<TViewComponent>

The same IViewComponentBuilder<TViewComponent>.

Extension Methods

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