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

Class ComponentBuilderAuthenticationExtensions

Contains authentication extension methods for IBaseTestBuilderWithComponentBuilder<TBuilder>.

Inheritance
System.Object
ComponentBuilderAuthenticationExtensions
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.Authentication.dll
Syntax
public static class ComponentBuilderAuthenticationExtensions

Methods

| Improve this Doc View Source

WithAuthenticatedUser<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>)

Sets default authenticated Microsoft.AspNetCore.Http.HttpContext.User to the built component with "TestId" identifier and "TestUser" username.

Declaration
public static TBuilder WithAuthenticatedUser<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder)where TBuilder : IBaseTestBuilder
Parameters
Type Name Description
IBaseTestBuilderWithComponentBuilder<TBuilder> builder

Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type.

Returns
Type Description
TBuilder

The same component builder.

Type Parameters
Name Description
TBuilder Class representing ASP.NET Core MVC test builder.
| Improve this Doc View Source

WithAuthenticatedUser<TBuilder>(IBaseTestBuilderWithComponentBuilder<TBuilder>, Action<IClaimsPrincipalBuilder>)

Sets custom authenticated Microsoft.AspNetCore.Http.HttpContext.User to the built component using the provided user builder.

Declaration
public static TBuilder WithAuthenticatedUser<TBuilder>(this IBaseTestBuilderWithComponentBuilder<TBuilder> builder, Action<IClaimsPrincipalBuilder> userBuilder)where TBuilder : IBaseTestBuilder
Parameters
Type Name Description
IBaseTestBuilderWithComponentBuilder<TBuilder> builder

Instance of IBaseTestBuilderWithComponentBuilder<TBuilder> type.

System.Action<IClaimsPrincipalBuilder> userBuilder

Action setting the Microsoft.AspNetCore.Http.HttpContext.User by using IClaimsPrincipalBuilder.

Returns
Type Description
TBuilder

The same component builder.

Type Parameters
Name Description
TBuilder
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 MyTestedASP.NET. All Rights Reserved. Generated by DocFX