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