Exemplo n.º 1
0
 /// <summary>
 /// Tests whether the action result is <see cref="Microsoft.AspNetCore.Mvc.SignInResult"/>
 /// with the same claims principal and authentication scheme as the provided ones.
 /// </summary>
 /// <typeparam name="TActionResult">Type of the action result.</typeparam>
 /// <param name="shouldReturnTestBuilder">Instance of <see cref="IShouldReturnTestBuilder{TActionResult}"/> type.</param>
 /// <param name="principal">Expected claims principal.</param>
 /// <param name="authenticationScheme">Expected authentication scheme.</param>
 /// <returns>Test builder of <see cref="IAndTestBuilder"/> type.</returns>
 public static IAndTestBuilder SignIn <TActionResult>(
     this IShouldReturnTestBuilder <TActionResult> shouldReturnTestBuilder,
     ClaimsPrincipal principal,
     string authenticationScheme)
 => shouldReturnTestBuilder
 .SignIn(result => result
         .WithPrincipal(principal)
         .WithAuthenticationScheme(authenticationScheme));