Example #1
0
 public static MockUserService GetMockUserService(
     IOptions <IdentityOptions> identityOptions = null,
     SignInManager <User> signInManager         = null,
     UserManager <User> userManager             = null,
     IHttpContextAccessor httpContextAccessor   = null,
     RoleManager <Group> roleManager            = null,
     IEmailService emailService   = null,
     IConfiguration configuration = null)
 {
     return(new MockUserService(
                identityOptions ?? new Mock <IOptions <IdentityOptions> >().Object,
                signInManager ?? MockSignInManager.GetMockSignInManager(userManager: userManager ?? MockUserManager.GetMockUserManager().Object).Object,
                userManager ?? MockUserManager.GetMockUserManager().Object,
                httpContextAccessor ?? new Mock <IHttpContextAccessor>().Object,
                roleManager ?? MockRoleManager.GetMockRoleManager().Object,
                emailService ?? new Mock <IEmailService>().Object,
                configuration ?? new Mock <IConfiguration>().Object));
 }
Example #2
0
 public static MockSignInManager GetMockSignInManager(
     UserManager <User> userManager   = null,
     IHttpContextAccessor httpContext = null,
     IUserClaimsPrincipalFactory <User> claimsPrincipalFactory = null,
     IOptions <IdentityOptions> options                 = null,
     ILogger <SignInManager <User> > logger             = null,
     IAuthenticationSchemeProvider authenticationScheme = null,
     IUserConfirmation <User> userConfirmation          = null
     )
 {
     return(new  MockSignInManager(
                userManager ?? MockUserManager.GetMockUserManager().Object,
                httpContext ?? new Mock <IHttpContextAccessor>().Object,
                claimsPrincipalFactory ?? new Mock <IUserClaimsPrincipalFactory <User> >().Object,
                options ?? new Mock <IOptions <IdentityOptions> >().Object,
                logger ?? new Mock <ILogger <SignInManager <User> > >().Object,
                authenticationScheme ?? new Mock <IAuthenticationSchemeProvider>().Object,
                userConfirmation ?? new Mock <IUserConfirmation <User> >().Object));
 }