Class ComponentBuilderDependencyInjectionExtensions
Contains dependency injection extension methods for IBaseTestBuilderWithComponentBuilder<TBuilder>.
Inheritance
System.Object
ComponentBuilderDependencyInjectionExtensions
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.DependencyInjection.dll
Syntax
public static class ComponentBuilderDependencyInjectionExtensions
Methods
| Improve this Doc View SourceWithServices<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, Action<IServicesBuilder>)
Sets services on the tested component.
Declaration
public static TBuilder WithServices<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, Action<IServicesBuilder> servicesBuilder)where TBuilder : IBaseTestBuilder
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
| System.Action<IServicesBuilder> | servicesBuilder | Action setting the services by using IServicesBuilder. |
Returns
| Type | Description |
|---|---|
| TBuilder | The same component builder. |
Type Parameters
| Name | Description |
|---|---|
| TBuilder | Class representing ASP.NET Core MVC test builder. |
WithServices<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, IEnumerable<Object>)
Sets constructor services on the tested component.
Declaration
public static TBuilder WithServices<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, IEnumerable<object> services)where TBuilder : IBaseTestBuilder
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
| System.Collections.Generic.IEnumerable<System.Object> | services | Collection of service dependencies to inject into the component constructor. |
Returns
| Type | Description |
|---|---|
| TBuilder | The same component builder. |
Type Parameters
| Name | Description |
|---|---|
| TBuilder | Class representing ASP.NET Core MVC test builder. |
WithServices<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, Object[])
Sets constructor services on the tested component.
Declaration
public static TBuilder WithServices<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, params object[] services)where TBuilder : IBaseTestBuilder
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseTestBuilderWithComponentBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type. |
| System.Object[] | services | Services to inject into the component constructor. |
Returns
| Type | Description |
|---|---|
| TBuilder | The same component builder. |
Type Parameters
| Name | Description |
|---|---|
| TBuilder | Class representing ASP.NET Core MVC test builder. |