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