15 references to AddToRoleAsync
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (5)
SqlStoreTestBase.cs (4)
168IdentityResultAssert.IsSuccess(await userMgr.AddToRoleAsync(user, roleName)); 192IdentityResultAssert.IsSuccess(await userMgr.AddToRoleAsync(user, roleName)); 252IdentityResultAssert.IsSuccess(await manager.AddToRoleAsync(user, admin.Name)); 253IdentityResultAssert.IsSuccess(await manager.AddToRoleAsync(user, local.Name));
UserStoreTest.cs (1)
207async () => await manager.AddToRoleAsync(u, "bogus"));
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
320result = await userManager.AddToRoleAsync(user, "role");
Microsoft.AspNetCore.Identity.Specification.Tests (6)
IdentitySpecificationTestBase.cs (6)
376IdentityResultAssert.IsSuccess(await manager.AddToRoleAsync(u, roleName)); 402IdentityResultAssert.IsSuccess(await userManager.AddToRoleAsync(u, await roleManager.GetRoleNameAsync(r))); 435IdentityResultAssert.IsSuccess(await userManager.AddToRoleAsync(user, await roleManager.GetRoleNameAsync(r))); 462IdentityResultAssert.IsSuccess(await userManager.AddToRoleAsync(u, roleName)); 507IdentityResultAssert.IsSuccess(await userMgr.AddToRoleAsync(user, roleName)); 509IdentityResultAssert.IsFailure(await userMgr.AddToRoleAsync(user, roleName), _errorDescriber.UserAlreadyInRole(roleName));
Microsoft.AspNetCore.Identity.Test (3)
UserManagerTest.cs (3)
1261await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AddToRoleAsync(null, "bogus")); 1397async () => await manager.AddToRoleAsync(null, null)); 1499await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddToRoleAsync(null, null));