84 instantiations of PocoUser
Microsoft.AspNetCore.Identity.Test (84)
SecurityStampValidatorTest.cs (7)
73var user = new PocoUser("test"); 133var user = new PocoUser("test"); 156var user = new PocoUser("test"); 199var user = new PocoUser("test"); 238var user = new PocoUser("test"); 274var user = new PocoUser("test"); 322var user = new PocoUser("test");
SignInManagerTest.cs (33)
34var user = new PocoUser { UserName = "Foo" }; 64var user = new PocoUser { UserName = "Foo" }; 121var user = new PocoUser { UserName = "Foo" }; 144var user = new PocoUser { UserName = "Foo" }; 168var user = new PocoUser { UserName = "Foo" }; 196var user = new PocoUser { UserName = "Foo" }; 240var user = new PocoUser { UserName = "Foo" }; 266var user = new PocoUser { UserName = "Foo" }; 303var user = new PocoUser { UserName = "Foo" }; 358var user = new PocoUser { UserName = "Foo" }; 399var user = new PocoUser { UserName = "Foo" }; 432var user = new PocoUser { UserName = "Foo" }; 479var user = new PocoUser { UserName = "Foo" }; 516var user = new PocoUser { UserName = "Foo" }; 565var user = new PocoUser { UserName = "Foo" }; 604var user = new PocoUser { UserName = "Foo" }; 657var user = new PocoUser { UserName = "Foo" }; 716var user = new PocoUser { UserName = "Foo" }; 751var user = new PocoUser { UserName = "Foo" }; 777var user = new PocoUser { UserName = "Foo" }; 835var user = new PocoUser { UserName = "Foo" }; 878var user = new PocoUser { UserName = "Foo" }; 905var user = new PocoUser { UserName = "Foo" }; 934var user = new PocoUser { UserName = "Foo" }; 992var user = new PocoUser { UserName = "Foo" }; 1033var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1064var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1095var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1139var user = new PocoUser { UserName = "Foo" }; 1162var user = new PocoUser { UserName = "Foo" }; 1187var user = new PocoUser { UserName = "Foo" }; 1226var user = new PocoUser { UserName = "Foo" }; 1252var user = new PocoUser { UserName = "Foo" };
UserClaimsPrincipalFactoryTest.cs (1)
45var user = new PocoUser { UserName = "Foo", Email = "foo@bar.com" };
UserManagerTest.cs (40)
68var user = new PocoUser { UserName = "Foo" }; 87var user = new PocoUser { UserName = "Foo", SecurityStamp = "sssss" }; 107var user = new PocoUser { UserName = "Foo", Email = "Foo@foo.com" }; 128var user = new PocoUser { UserName = "Foo" }; 146var user = new PocoUser { UserName = "Foo" }; 166var user = new PocoUser { UserName = "Foo", Email = "email" }; 188var user = new PocoUser(); 208var user = new PocoUser { UserName = "Foo" }; 226var user = new PocoUser { UserName = "Foo" }; 243var user = new PocoUser { UserName = "Foo" }; 262var user = new PocoUser { Email = "Foo" }; 279var user = new PocoUser { Email = "Foo" }; 303var user = new PocoUser { Email = "Foo" }; 321var user = new PocoUser { UserName = "Foo", Email = "Bar" }; 340var user = new PocoUser { UserName = "Foo" }; 378var user = new PocoUser { UserName = "Foo" }; 418var user = new PocoUser { UserName = "Foo" }; 442var user = new PocoUser { UserName = "Foo" }; 479var user = new PocoUser { UserName = "Foo" }; 505var user = new PocoUser { UserName = "Foo" }; 526var user = new PocoUser { UserName = "Foo" }; 547var user = new PocoUser { UserName = "Foo" }; 570var user = new PocoUser { UserName = "Foo" }; 601var user = new PocoUser { UserName = "nulldude" }; 618var user = new PocoUser { UserName = "nulldude" }; 634var user = new PocoUser { UserName = "Foo" }; 655var user = new PocoUser { UserName = "Foo" }; 712var user = new PocoUser(); 742() => manager.VerifyChangePhoneNumberTokenAsync(new PocoUser(), "1", "111-111-1111")); 744() => manager.GenerateChangePhoneNumberTokenAsync(new PocoUser(), "111-111-1111")); 801await Assert.ThrowsAsync<NotImplementedException>(() => manager.GenerateUserTokenAsync(new PocoUser(), "A", "purpose")); 898await Assert.ThrowsAsync<NotImplementedException>(() => manager.GenerateUserTokenAsync(new PocoUser(), TokenOptions.DefaultProvider, "purpose")); 988IdentityResultAssert.IsFailure(await manager.CreateAsync(new PocoUser(), "password"), 998IdentityResultAssert.IsFailure(await manager.CreateAsync(new PocoUser(), "password")); 1004var user = new PocoUser() { UserName = Guid.NewGuid().ToString() }; 1027async () => await manager.CreateAsync(new PocoUser(), null)); 1041await Assert.ThrowsAsync<ArgumentNullException>("roles", async () => await manager.AddToRolesAsync(new PocoUser(), null)); 1042await Assert.ThrowsAsync<ArgumentNullException>("roles", async () => await manager.RemoveFromRolesAsync(new PocoUser(), null)); 1757var user = new PocoUser() { UserName = "dupeEmail", Email = "dupe@email.com" }; 1758var user2 = new PocoUser() { UserName = "dupeEmail2", Email = "dupe@email.com" };
UserValidatorTest.cs (3)
29var user = new PocoUser { UserName = input }; 51var user = new PocoUser { UserName = userName }; 79var user = new PocoUser { UserName = userName };
498 references to PocoUser
Microsoft.AspNetCore.Identity.Test (498)
IdentityBuilderTest.cs (67)
17services.AddIdentityCore<PocoUser>(o => { }) 26Assert.IsType<UserClaimsPrincipalFactory<PocoUser, PocoRole>>(sp.GetRequiredService<IUserClaimsPrincipalFactory<PocoUser>>()); 38Assert.Throws<ArgumentException>(() => new IdentityBuilder(typeof(PocoUser), typeof(int), new ServiceCollection())); 45services.AddIdentityCore<PocoUser>(o => { }) 58services.AddIdentity<PocoUser, PocoRole>().AddUserStore<MyUberThingy>(); 59var thingy = services.BuildServiceProvider().GetRequiredService<IUserStore<PocoUser>>() as MyUberThingy; 68services.AddIdentity<PocoUser, PocoRole>().AddRoleStore<MyUberThingy>(); 79services.AddIdentity<PocoUser, PocoRole>() 84var thingy = services.BuildServiceProvider().GetRequiredService<IUserClaimsPrincipalFactory<PocoUser>>() as MyClaimsPrincipalFactory; 94services.AddIdentity<PocoUser, PocoRole>() 100var thingy = services.BuildServiceProvider().GetRequiredService<IUserConfirmation<PocoUser>>() as MyUserConfirmation; 109services.AddIdentity<PocoUser, PocoRole>().AddRoleValidator<MyUberThingy>(); 119services.AddIdentity<PocoUser, PocoRole>().AddUserValidator<MyUberThingy>(); 120var thingy = services.BuildServiceProvider().GetRequiredService<IUserValidator<PocoUser>>() as MyUberThingy; 129services.AddIdentity<PocoUser, PocoRole>().AddPasswordValidator<MyUberThingy>(); 130var thingy = services.BuildServiceProvider().GetRequiredService<IPasswordValidator<PocoUser>>() as MyUberThingy; 139services.AddIdentity<PocoUser, PocoRole>() 142var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(UserManager<PocoUser>)) as MyUserManager; 151services.AddIdentity<PocoUser, PocoRole>() 165services.AddIdentity<PocoUser, PocoRole>() 171var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(SignInManager<PocoUser>)) as MySignInManager; 181.AddIdentity<PocoUser, PocoRole>() 186var userValidator = provider.GetRequiredService<IUserValidator<PocoUser>>() as UserValidator<PocoUser>; 189var pwdValidator = provider.GetRequiredService<IPasswordValidator<PocoUser>>() as PasswordValidator<PocoUser>; 192var hasher = provider.GetRequiredService<IPasswordHasher<PocoUser>>() as PasswordHasher<PocoUser>; 196Assert.IsType<UserManager<PocoUser>>(provider.GetRequiredService<UserManager<PocoUser>>()); 205.AddIdentity<PocoUser, PocoRole>() 212Assert.IsType<MySignInManager>(provider.GetRequiredService<SignInManager<PocoUser>>()); 213Assert.IsType<SecurityStampValidator<PocoUser>>(provider.GetRequiredService<ISecurityStampValidator>()); 214Assert.IsType<TwoFactorSecurityStampValidator<PocoUser>>(provider.GetRequiredService<ITwoFactorSecurityStampValidator>()); 224.AddIdentityCore<PocoUser>() 232Assert.IsType<MySignInManager>(provider.GetRequiredService<SignInManager<PocoUser>>()); 233Assert.IsType<SecurityStampValidator<PocoUser>>(provider.GetRequiredService<ISecurityStampValidator>()); 234Assert.IsType<TwoFactorSecurityStampValidator<PocoUser>>(provider.GetRequiredService<ITwoFactorSecurityStampValidator>()); 243services.AddIdentity<PocoUser, PocoRole>().AddDefaultTokenProviders(); 255var builder = services.AddIdentity<PocoUser, PocoRole>(); 266var builder = services.AddIdentity<PocoUser, PocoRole>(); 271private class MyUberThingy : IUserValidator<PocoUser>, IPasswordValidator<PocoUser>, IRoleValidator<PocoRole>, IUserStore<PocoUser>, IRoleStore<PocoRole> 278public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 288public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 298public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) 303public Task<PocoUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken)) 313public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 328public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 333public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 343public Task SetNormalizedUserNameAsync(PocoUser user, string normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 353public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 363public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 373public Task<IdentityResult> ValidateAsync(UserManager<PocoUser> manager, PocoUser user) 378public Task<IdentityResult> ValidateAsync(UserManager<PocoUser> manager, PocoUser user, string password) 394private class MySignInManager : SignInManager<PocoUser> 396public MySignInManager(UserManager<PocoUser> manager, IHttpContextAccessor context, IUserClaimsPrincipalFactory<PocoUser> claimsFactory) : base(manager, context, claimsFactory, null, null, null, null) { } 399private class MyUserManager : UserManager<PocoUser> 401public MyUserManager(IUserStore<PocoUser> store) : base(store, null, null, null, null, null, null, null, null) { } 404private class MyClaimsPrincipalFactory : UserClaimsPrincipalFactory<PocoUser, PocoRole> 406public MyClaimsPrincipalFactory(UserManager<PocoUser> userManager, RoleManager<PocoRole> roleManager, IOptions<IdentityOptions> optionsAccessor) : base(userManager, roleManager, optionsAccessor) 420private class MyUserConfirmation : DefaultUserConfirmation<PocoUser>
IdentityOptionsTest.cs (2)
41services.AddIdentity<PocoUser, PocoRole>(); 61services.AddIdentity<PocoUser, PocoRole>(options => options.User.RequireUniqueEmail = true);
NoopUserStore.cs (13)
6public class NoopUserStore : IUserStore<PocoUser> 8public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 13public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 18public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 23public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 28public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 33public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) 35return Task.FromResult<PocoUser>(null); 38public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken)) 40return Task.FromResult<PocoUser>(null); 47public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 52public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 57public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken))
PasswordValidatorTest.cs (15)
23var validator = new PasswordValidator<PocoUser>(); 38var manager = MockHelpers.TestUserManager<PocoUser>(); 39var valid = new PasswordValidator<PocoUser>(); 52var manager = MockHelpers.TestUserManager<PocoUser>(); 53var valid = new PasswordValidator<PocoUser>(); 66var manager = MockHelpers.TestUserManager<PocoUser>(); 67var valid = new PasswordValidator<PocoUser>(); 83var manager = MockHelpers.TestUserManager<PocoUser>(); 84var valid = new PasswordValidator<PocoUser>(); 99var manager = MockHelpers.TestUserManager<PocoUser>(); 100var valid = new PasswordValidator<PocoUser>(); 120var manager = MockHelpers.TestUserManager<PocoUser>(); 121var valid = new PasswordValidator<PocoUser>(); 145var manager = MockHelpers.TestUserManager<PocoUser>(); 146var valid = new PasswordValidator<PocoUser>();
SecurityStampValidatorTest.cs (40)
73var user = new PocoUser("test"); 95private async Task RunApplicationCookieTest(PocoUser user, Mock<HttpContext> httpContext, bool shouldStampValidate, Func<Task> testCode) 97var userManager = MockHelpers.MockUserManager<PocoUser>(); 98var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 105var signInManager = new Mock<SignInManager<PocoUser>>(userManager.Object, 106contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 122services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 133var user = new PocoUser("test"); 156var user = new PocoUser("test"); 159var userManager = MockHelpers.MockUserManager<PocoUser>(); 161var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 168var signInManager = new SignInManager<PocoUser>(userManager.Object, 169contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 176services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager, new LoggerFactory())); 199var user = new PocoUser("test"); 201var userManager = MockHelpers.MockUserManager<PocoUser>(); 204var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 209var signInManager = new Mock<SignInManager<PocoUser>>(userManager.Object, 210contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 211signInManager.Setup(s => s.ValidateSecurityStampAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(default(PocoUser)).Verifiable(); 217services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 238var user = new PocoUser("test"); 240var userManager = MockHelpers.MockUserManager<PocoUser>(); 243var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 248var signInManager = new Mock<SignInManager<PocoUser>>(userManager.Object, 249contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 255services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 274var user = new PocoUser("test"); 277var userManager = MockHelpers.MockUserManager<PocoUser>(); 280var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 285var signInManager = new Mock<SignInManager<PocoUser>>(userManager.Object, 286contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 288signInManager.Setup(s => s.CreateUserPrincipalAsync(It.IsAny<PocoUser>())).Returns(Task.FromResult(new ClaimsPrincipal(new ClaimsIdentity("auth")))); 293services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 322var user = new PocoUser("test"); 324var userManager = MockHelpers.MockUserManager<PocoUser>(); 326var claimsManager = new Mock<IUserClaimsPrincipalFactory<PocoUser>>(); 333var signInManager = new Mock<SignInManager<PocoUser>>(userManager.Object, 334contextAccessor.Object, claimsManager.Object, identityOptions.Object, null, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 342services.AddSingleton<ITwoFactorSecurityStampValidator>(new TwoFactorSecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory()));
SignInManagerTest.cs (95)
21Assert.Throws<ArgumentNullException>("userManager", () => new SignInManager<PocoUser>(null, null, null, null, null, null, null)); 22var userManager = MockHelpers.MockUserManager<PocoUser>().Object; 23Assert.Throws<ArgumentNullException>("contextAccessor", () => new SignInManager<PocoUser>(userManager, null, null, null, null, null, null)); 27Assert.Throws<ArgumentNullException>("claimsFactory", () => new SignInManager<PocoUser>(userManager, contextAccessor.Object, null, null, null, null, null)); 34var user = new PocoUser { UserName = "Foo" }; 46var claimsFactory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(manager.Object, roleManager.Object, options.Object); 47var logger = new TestLogger<SignInManager<PocoUser>>(); 48var helper = new SignInManager<PocoUser>(manager.Object, contextAccessor.Object, claimsFactory, options.Object, logger, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 64var user = new PocoUser { UserName = "Foo" }; 76var claimsFactory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(manager.Object, roleManager.Object, options.Object); 77var logger = new TestLogger<SignInManager<PocoUser>>(); 78var helper = new SignInManager<PocoUser>(manager.Object, contextAccessor.Object, claimsFactory, options.Object, logger, new Mock<IAuthenticationSchemeProvider>().Object, new DefaultUserConfirmation<PocoUser>()); 90private static Mock<UserManager<PocoUser>> SetupUserManager(PocoUser user) 92var manager = MockHelpers.MockUserManager<PocoUser>(); 100private static SignInManager<PocoUser> SetupSignInManager(UserManager<PocoUser> manager, HttpContext context, ILogger logger = null, IdentityOptions identityOptions = null, IAuthenticationSchemeProvider schemeProvider = null) 108var claimsFactory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(manager, roleManager.Object, options.Object); 110var sm = new SignInManager<PocoUser>(manager, contextAccessor.Object, claimsFactory, options.Object, null, schemeProvider, new DefaultUserConfirmation<PocoUser>()); 111sm.Logger = logger ?? NullLogger<SignInManager<PocoUser>>.Instance; 121var user = new PocoUser { UserName = "Foo" }; 144var user = new PocoUser { UserName = "Foo" }; 168var user = new PocoUser { UserName = "Foo" }; 196var user = new PocoUser { UserName = "Foo" }; 240var user = new PocoUser { UserName = "Foo" }; 266var user = new PocoUser { UserName = "Foo" }; 303var user = new PocoUser { UserName = "Foo" }; 342private class GoodTokenProvider : AuthenticatorTokenProvider<PocoUser> 344public override Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user) 358var user = new PocoUser { UserName = "Foo" }; 368var twoFactorInfo = new SignInManager<PocoUser>.TwoFactorAuthenticationInfo { User = user }; 373var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, null); 399var user = new PocoUser { UserName = "Foo" }; 410var twoFactorInfo = new SignInManager<PocoUser>.TwoFactorAuthenticationInfo { User = user }; 415var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, null); 432var user = new PocoUser { UserName = "Foo" }; 449var twoFactorInfo = new SignInManager<PocoUser>.TwoFactorAuthenticationInfo { User = user }; 454var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, null); 479var user = new PocoUser { UserName = "Foo" }; 516var user = new PocoUser { UserName = "Foo" }; 528var twoFactorInfo = new SignInManager<PocoUser>.TwoFactorAuthenticationInfo { User = user }; 530var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, externalLogin ? loginProvider : null); 565var user = new PocoUser { UserName = "Foo" }; 604var user = new PocoUser { UserName = "Foo" }; 619var signInManager = new Mock<SignInManager<PocoUser>>(manager.Object, 621new Mock<IUserClaimsPrincipalFactory<PocoUser>>().Object, 657var user = new PocoUser { UserName = "Foo" }; 671var twoFactorInfo = new SignInManager<PocoUser>.TwoFactorAuthenticationInfo { User = user }; 673var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, externalLogin ? loginProvider : null); 716var user = new PocoUser { UserName = "Foo" }; 733var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, loginProvider: null); 751var user = new PocoUser { UserName = "Foo" }; 777var user = new PocoUser { UserName = "Foo" }; 816var manager = MockHelpers.TestUserManager<PocoUser>(); 835var user = new PocoUser { UserName = "Foo" }; 841var logger = new TestLogger<SignInManager<PocoUser>>(); 860var manager = MockHelpers.MockUserManager<PocoUser>(); 861manager.Setup(m => m.FindByNameAsync("unknown-username")).ReturnsAsync(default(PocoUser)).Verifiable(); 878var user = new PocoUser { UserName = "Foo" }; 905var user = new PocoUser { UserName = "Foo" }; 934var user = new PocoUser { UserName = "Foo" }; 950var logger = new TestLogger<SignInManager<PocoUser>>(); 992var user = new PocoUser { UserName = "Foo" }; 1005var logger = new TestLogger<SignInManager<PocoUser>>(); 1033var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1064var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1095var user = new PocoUser { Id = "foo", UserName = "Foo" }; 1128new[] { nameof(SignInManager<PocoUser>) }, 1129new[] { nameof(NoOverridesSignInManager<PocoUser>) }, 1130new[] { nameof(OverrideAndAwaitBaseResetSignInManager<PocoUser>) }, 1131new[] { nameof(OverrideAndPassThroughUserManagerResetSignInManager<PocoUser>) }, 1139var user = new PocoUser { UserName = "Foo" }; 1162var user = new PocoUser { UserName = "Foo" }; 1187var user = new PocoUser { UserName = "Foo" }; 1200var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, null); 1226var user = new PocoUser { UserName = "Foo" }; 1252var user = new PocoUser { UserName = "Foo" }; 1266var id = SignInManager<PocoUser>.StoreTwoFactorInfo(user.Id, null); 1279private static SignInManager<PocoUser> SetupSignInManagerType(UserManager<PocoUser> manager, HttpContext context, string typeName) 1285var claimsFactory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(manager, roleManager.Object, options); 1289nameof(SignInManager<PocoUser>) => new SignInManager<PocoUser>(manager, contextAccessor.Object, claimsFactory, options, NullLogger<SignInManager<PocoUser>>.Instance, Mock.Of<IAuthenticationSchemeProvider>(), new DefaultUserConfirmation<PocoUser>()), 1290nameof(NoOverridesSignInManager<PocoUser>) => new NoOverridesSignInManager<PocoUser>(manager, contextAccessor.Object, claimsFactory, options), 1291nameof(OverrideAndAwaitBaseResetSignInManager<PocoUser>) => new OverrideAndAwaitBaseResetSignInManager<PocoUser>(manager, contextAccessor.Object, claimsFactory, options), 1292nameof(OverrideAndPassThroughUserManagerResetSignInManager<PocoUser>) => new OverrideAndPassThroughUserManagerResetSignInManager<PocoUser>(manager, contextAccessor.Object, claimsFactory, options),
UserClaimsPrincipalFactoryTest.cs (6)
15var userManager = MockHelpers.MockUserManager<PocoUser>().Object; 19() => new UserClaimsPrincipalFactory<PocoUser, PocoRole>(userManager, roleManager, options.Object)); 22var factory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(userManager, roleManager, options.Object); 43var userManager = MockHelpers.MockUserManager<PocoUser>(); 45var user = new PocoUser { UserName = "Foo", Email = "foo@bar.com" }; 83var factory = new UserClaimsPrincipalFactory<PocoUser, PocoRole>(userManager.Object, roleManager.Object, options.Object);
UserManagerTest.cs (253)
20.AddTransient<IUserStore<PocoUser>, NoopUserStore>(); 21services.AddIdentity<PocoUser, PocoRole>(); 24var manager = services.BuildServiceProvider().GetRequiredService<UserManager<PocoUser>>(); 35.AddTransient<IUserStore<PocoUser>, NoopUserStore>() 40services.AddIdentity<PocoUser, PocoRole>() 44Assert.Same(provider.GetRequiredService<UserManager<PocoUser>>(), 50public class CustomUserManager : UserManager<PocoUser> 52public CustomUserManager() : base(new Mock<IUserStore<PocoUser>>().Object, null, null, null, null, null, null, null, null) 67var store = new Mock<IUserStore<PocoUser>>(); 68var user = new PocoUser { UserName = "Foo" }; 72var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 86var store = new Mock<IUserSecurityStampStore<PocoUser>>(); 87var user = new PocoUser { UserName = "Foo", SecurityStamp = "sssss" }; 91var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 106var store = new Mock<IUserEmailStore<PocoUser>>(); 107var user = new PocoUser { UserName = "Foo", Email = "Foo@foo.com" }; 113var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 127var store = new Mock<IUserStore<PocoUser>>(); 128var user = new PocoUser { UserName = "Foo" }; 145var store = new Mock<IUserStore<PocoUser>>(); 146var user = new PocoUser { UserName = "Foo" }; 165var store = new Mock<IUserEmailStore<PocoUser>>(); 166var user = new PocoUser { UserName = "Foo", Email = "email" }; 187var store = new Mock<IUserStore<PocoUser>>(); 188var user = new PocoUser(); 207var store = new Mock<IUserStore<PocoUser>>(); 208var user = new PocoUser { UserName = "Foo" }; 210var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 213var result = await userManager.FindByIdAsync(user.Id); 225var store = new Mock<IUserStore<PocoUser>>(); 226var user = new PocoUser { UserName = "Foo" }; 228var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 231var result = await userManager.FindByNameAsync(user.UserName); 242var store = new Mock<IUserStore<PocoUser>>(); 243var user = new PocoUser { UserName = "Foo" }; 249var result = await userManager.FindByNameAsync(user.UserName); 261var store = new Mock<IUserEmailStore<PocoUser>>(); 262var user = new PocoUser { Email = "Foo" }; 267var result = await userManager.FindByEmailAsync(user.Email); 278var store = new Mock<IUserEmailStore<PocoUser>>(); 279var user = new PocoUser { Email = "Foo" }; 285var result = await userManager.FindByEmailAsync(user.Email); 302var store = new Mock<IUserEmailStore<PocoUser>>(); 303var user = new PocoUser { Email = "Foo" }; 309var result = await userManager.FindByEmailAsync(user.Email); 320var store = new Mock<IUserEmailStore<PocoUser>>(); 321var user = new PocoUser { UserName = "Foo", Email = "Bar" }; 327var result = await userManager.FindByNameAsync(user.UserName); 339var store = new Mock<IUserRoleStore<PocoUser>>(); 340var user = new PocoUser { UserName = "Foo" }; 362var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 377var store = new Mock<IUserRoleStore<PocoUser>>(); 378var user = new PocoUser { UserName = "Foo" }; 400var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 417var store = new Mock<IUserRoleStore<PocoUser>>(); 418var user = new PocoUser { UserName = "Foo" }; 441var store = new Mock<IUserRoleStore<PocoUser>>(); 442var user = new PocoUser { UserName = "Foo" }; 463var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 478var store = new Mock<IUserRoleStore<PocoUser>>(); 479var user = new PocoUser { UserName = "Foo" }; 490var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 504var store = new Mock<IUserClaimStore<PocoUser>>(); 505var user = new PocoUser { UserName = "Foo" }; 525var store = new Mock<IUserClaimStore<PocoUser>>(); 526var user = new PocoUser { UserName = "Foo" }; 546var store = new Mock<IUserClaimStore<PocoUser>>(); 547var user = new PocoUser { UserName = "Foo" }; 568var store = new Mock<IUserPasswordStore<PocoUser>>(); 569var hasher = new Mock<IPasswordHasher<PocoUser>>(); 570var user = new PocoUser { UserName = "Foo" }; 579store.Setup(x => x.UpdateAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(IdentityResult.Success)); 599var store = new Mock<IUserSecurityStampStore<PocoUser>>(); 601var user = new PocoUser { UserName = "nulldude" }; 616var store = new Mock<IUserSecurityStampStore<PocoUser>>(); 618var user = new PocoUser { UserName = "nulldude" }; 633var store = new Mock<IUserClaimStore<PocoUser>>(); 634var user = new PocoUser { UserName = "Foo" }; 654var store = new Mock<IUserClaimStore<PocoUser>>(); 655var user = new PocoUser { UserName = "Foo" }; 661var userManager = MockHelpers.TestUserManager<PocoUser>(store.Object); 712var user = new PocoUser(); 735var store = new Mock<IUserStore<PocoUser>>(); 736store.Setup(x => x.GetUserIdAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(Guid.NewGuid().ToString())); 769private class ATokenProvider : IUserTwoFactorTokenProvider<PocoUser> 771public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user) 776public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user) 781public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user) 796services.AddIdentity<PocoUser, PocoRole>(o => o.Tokens.ProviderMap.Add("A", new TokenProviderDescriptor(typeof(ATokenProvider)) 800var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>(); 809services.AddIdentity<PocoUser, PocoRole>(o => o.Stores.ProtectPersonalData = true) 811var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 820services.AddIdentity<PocoUser, PocoRole>(o => o.Stores.ProtectPersonalData = true) 822var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 826private class ProtectedStore : IProtectedUserStore<PocoUser> 828public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken) 833public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken) 843public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken) 848public Task<PocoUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken) 853public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken) 858public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken) 863public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken) 868public Task SetNormalizedUserNameAsync(PocoUser user, string normalizedName, CancellationToken cancellationToken) 873public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken) 878public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken) 893services.AddIdentity<PocoUser, PocoRole>(o => o.Tokens.ProviderMap.Add(TokenOptions.DefaultProvider, new TokenProviderDescriptor(typeof(ATokenProvider)) 897var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>(); 987manager.PasswordValidators.Add(new BadPasswordValidator<PocoUser>(true)); 989BadPasswordValidator<PocoUser>.ErrorMessage); 997manager.PasswordValidators.Add(new BadPasswordValidator<PocoUser>()); 1004var user = new PocoUser() { UserName = Guid.NewGuid().ToString() }; 1005var store = new Mock<IUserLockoutStore<PocoUser>>(); 1019() => new UserManager<PocoUser>(null, null, null, null, null, null, null, null, null)); 1208IUserPasswordStore<PocoUser>, 1209IUserClaimStore<PocoUser>, 1210IUserLoginStore<PocoUser>, 1211IUserEmailStore<PocoUser>, 1212IUserPhoneNumberStore<PocoUser>, 1213IUserLockoutStore<PocoUser>, 1214IUserTwoFactorStore<PocoUser>, 1215IUserRoleStore<PocoUser>, 1216IUserSecurityStampStore<PocoUser> 1218public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1223public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken)) 1228public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 1233public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken)) 1238public Task SetEmailAsync(PocoUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 1243public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1248public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1253public Task SetEmailConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1258public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken)) 1260return Task.FromResult<PocoUser>(null); 1263public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1268public Task SetLockoutEndDateAsync(PocoUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 1273public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1278public Task ResetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1283public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1288public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1293public Task SetLockoutEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1298public Task AddLoginAsync(PocoUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) 1303public Task RemoveLoginAsync(PocoUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1308public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1313public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1315return Task.FromResult<PocoUser>(null); 1322public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1327public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1332public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1337public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1342public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) 1344return Task.FromResult<PocoUser>(null); 1347public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken)) 1349return Task.FromResult<PocoUser>(null); 1352public Task SetPasswordHashAsync(PocoUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 1357public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1362public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1367public Task SetPhoneNumberAsync(PocoUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 1372public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1377public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1382public Task SetPhoneNumberConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1387public Task AddToRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1392public Task RemoveFromRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1397public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1402public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1407public Task SetSecurityStampAsync(PocoUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 1412public Task<string> GetSecurityStampAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1417public Task SetTwoFactorEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1422public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1427public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1432public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1437public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1442public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1447public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 1449return Task.FromResult<IList<PocoUser>>(new List<PocoUser>()); 1452public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1454return Task.FromResult<IList<PocoUser>>(new List<PocoUser>()); 1457public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1462public Task SetNormalizedEmailAsync(PocoUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 1468private class NoOpTokenProvider : IUserTwoFactorTokenProvider<PocoUser> 1472public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user) 1477public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user) 1482public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user) 1489IUserPasswordStore<PocoUser>, 1490IUserClaimStore<PocoUser>, 1491IUserLoginStore<PocoUser>, 1492IUserRoleStore<PocoUser>, 1493IUserEmailStore<PocoUser>, 1494IUserPhoneNumberStore<PocoUser>, 1495IUserLockoutStore<PocoUser>, 1496IUserTwoFactorStore<PocoUser> 1498public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1503public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 1508public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 1513public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 1518public Task SetEmailAsync(PocoUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 1523public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1528public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1533public Task SetEmailConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1538public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken)) 1543public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1548public Task SetLockoutEndDateAsync(PocoUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 1553public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1558public Task ResetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1563public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1568public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1573public Task SetLockoutEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1578public Task AddLoginAsync(PocoUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) 1583public Task RemoveLoginAsync(PocoUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1588public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1593public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1603public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1608public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1613public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1618public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) 1623public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken)) 1628public Task SetPasswordHashAsync(PocoUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 1633public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1638public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1643public Task SetPhoneNumberAsync(PocoUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 1648public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1653public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1658public Task SetPhoneNumberConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1663public Task SetTwoFactorEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1668public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1673public Task AddToRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1678public Task RemoveFromRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1683public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1688public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1693public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1698public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1703public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 1708public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1713Task<IdentityResult> IUserStore<PocoUser>.CreateAsync(PocoUser user, CancellationToken cancellationToken) 1718Task<IdentityResult> IUserStore<PocoUser>.UpdateAsync(PocoUser user, CancellationToken cancellationToken) 1723Task<IdentityResult> IUserStore<PocoUser>.DeleteAsync(PocoUser user, CancellationToken cancellationToken) 1728public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1733public Task SetNormalizedEmailAsync(PocoUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 1742var store = new Mock<IUserEmailStore<PocoUser>>(); 1749.AddSingleton<IUserStore<PocoUser>>(store.Object) 1752services.AddIdentity<PocoUser, PocoRole>(); 1754var manager = services.BuildServiceProvider().GetRequiredService<UserManager<PocoUser>>(); 1757var user = new PocoUser() { UserName = "dupeEmail", Email = "dupe@email.com" }; 1758var user2 = new PocoUser() { UserName = "dupeEmail2", Email = "dupe@email.com" };
UserValidatorTest.cs (7)
13var validator = new UserValidator<PocoUser>(); 28var validator = new UserValidator<PocoUser>(); 29var user = new PocoUser { UserName = input }; 50var validator = new UserValidator<PocoUser>(); 51var user = new PocoUser { UserName = userName }; 78var validator = new UserValidator<PocoUser>(); 79var user = new PocoUser { UserName = userName };