C# Class MyTested.AspNetCore.Mvc.HttpRequestBuilderAuthenticationExtensions

Contains authentication extension methods for IHttpRequestBuilder.
ファイルを表示 Open project: ivaylokenov/MyTested.AspNetCore.Mvc

Public Methods

Method Description
WithAuthenticatedUser ( this httpRequestBuilder ) : IAndHttpRequestBuilder

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

WithAuthenticatedUser ( this httpRequestBuilder, Action userBuilder ) : IAndHttpRequestBuilder

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

Method Details

WithAuthenticatedUser() public static method

Sets default authenticated Microsoft.AspNetCore.Http.HttpContext.User to the built request with "TestId" identifier and "TestUser" username.
public static WithAuthenticatedUser ( this httpRequestBuilder ) : IAndHttpRequestBuilder
httpRequestBuilder this Instance of type.
return IAndHttpRequestBuilder

WithAuthenticatedUser() public static method

Sets custom authenticated Microsoft.AspNetCore.Http.HttpContext.User to the built request using the provided user builder.
public static WithAuthenticatedUser ( this httpRequestBuilder, Action userBuilder ) : IAndHttpRequestBuilder
httpRequestBuilder this Instance of type.
userBuilder Action Action setting the by using .
return IAndHttpRequestBuilder