15 references to AddToRoleAsync
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (5)
SqlStoreTestBase.cs (4)
167
IdentityResultAssert.IsSuccess(await userMgr.
AddToRoleAsync
(user, roleName));
191
IdentityResultAssert.IsSuccess(await userMgr.
AddToRoleAsync
(user, roleName));
251
IdentityResultAssert.IsSuccess(await manager.
AddToRoleAsync
(user, admin.Name));
252
IdentityResultAssert.IsSuccess(await manager.
AddToRoleAsync
(user, local.Name));
UserStoreTest.cs (1)
205
async () => await manager.
AddToRoleAsync
(u, "bogus"));
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
320
result = await userManager.
AddToRoleAsync
(user, "role");
Microsoft.AspNetCore.Identity.Specification.Tests (6)
IdentitySpecificationTestBase.cs (6)
375
IdentityResultAssert.IsSuccess(await manager.
AddToRoleAsync
(u, roleName));
401
IdentityResultAssert.IsSuccess(await userManager.
AddToRoleAsync
(u, await roleManager.GetRoleNameAsync(r)));
434
IdentityResultAssert.IsSuccess(await userManager.
AddToRoleAsync
(user, await roleManager.GetRoleNameAsync(r)));
461
IdentityResultAssert.IsSuccess(await userManager.
AddToRoleAsync
(u, roleName));
506
IdentityResultAssert.IsSuccess(await userMgr.
AddToRoleAsync
(user, roleName));
508
IdentityResultAssert.IsFailure(await userMgr.
AddToRoleAsync
(user, roleName), _errorDescriber.UserAlreadyInRole(roleName));
Microsoft.AspNetCore.Identity.Test (3)
UserManagerTest.cs (3)
929
await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.
AddToRoleAsync
(null, "bogus"));
1061
async () => await manager.
AddToRoleAsync
(null, null));
1155
await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.
AddToRoleAsync
(null, null));