3 types derived from RoleManager
Microsoft.AspNetCore.Identity (1)
AspNetRoleManager.cs (1)
13public class AspNetRoleManager<TRole> : RoleManager<TRole>, IDisposable where TRole : class
Microsoft.AspNetCore.Identity.Test (2)
IdentityBuilderTest.cs (1)
411private class MyRoleManager : RoleManager<PocoRole>
UserManagerTest.cs (1)
56public class CustomRoleManager : RoleManager<PocoRole>
4 instantiations of RoleManager
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
59return new RoleManager<TRole>(store, roles,
Microsoft.AspNetCore.Identity.InMemory.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
59return new RoleManager<TRole>(store, roles,
Microsoft.AspNetCore.Identity.Test (2)
RoleManagerTest.cs (1)
124() => new RoleManager<PocoRole>(null, null, null, null, null));
src\Identity\test\Shared\MockHelpers.cs (1)
59return new RoleManager<TRole>(store, roles,
100 references to RoleManager
Microsoft.AspNetCore.Identity (3)
AspNetRoleManager.cs (2)
18/// Constructs a new instance of <see cref="RoleManager{TRole}"/>. 30ILogger<RoleManager<TRole>> logger,
IdentityServiceCollectionExtensions.cs (1)
107services.TryAddScoped<RoleManager<TRole>>();
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (23)
SqlStoreTestBase.cs (5)
54services.AddSingleton<ILogger<RoleManager<TRole>>>(new TestLogger<RoleManager<TRole>>()); 160var roleMgr = CreateRoleManager(context); 184var roleMgr = CreateRoleManager(); 244var role = CreateRoleManager(context);
src\Identity\test\Shared\MockHelpers.cs (3)
24public static Mock<RoleManager<TRole>> MockRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class 29return new Mock<RoleManager<TRole>>(store, roles, MockLookupNormalizer(), 54public static RoleManager<TRole> TestRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class
UserStoreGuidKeyTest.cs (2)
67Assert.NotNull(sp.GetRequiredService<RoleManager<GuidRole>>()); 84Assert.NotNull(sp.GetRequiredService<RoleManager<IdentityRole<Guid>>>());
UserStoreIntKeyTest.cs (2)
45Assert.NotNull(sp.GetRequiredService<RoleManager<IntRole>>()); 62Assert.NotNull(sp.GetRequiredService<RoleManager<IdentityRole<int>>>());
UserStoreStringKeyTest.cs (2)
46Assert.NotNull(sp.GetRequiredService<RoleManager<StringRole>>()); 63Assert.NotNull(sp.GetRequiredService<RoleManager<IdentityRole<string>>>());
UserStoreTest.cs (9)
307var manager = CreateRoleManager(db); 313var manager1 = CreateRoleManager(db); 314var manager2 = CreateRoleManager(db2); 338var manager = CreateRoleManager(db); 344var manager1 = CreateRoleManager(db); 345var manager2 = CreateRoleManager(db2); 368var manager = CreateRoleManager(db); 374var manager1 = CreateRoleManager(db); 375var manager2 = CreateRoleManager(db2);
Microsoft.AspNetCore.Identity.InMemory.Test (5)
FunctionalTest.cs (2)
303var roleManager = context.RequestServices.GetRequiredService<RoleManager<PocoRole>>();
src\Identity\test\Shared\MockHelpers.cs (3)
24public static Mock<RoleManager<TRole>> MockRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class 29return new Mock<RoleManager<TRole>>(store, roles, MockLookupNormalizer(), 54public static RoleManager<TRole> TestRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class
Microsoft.AspNetCore.Identity.Specification.Tests (28)
IdentitySpecificationTestBase.cs (28)
56services.AddSingleton<ILogger<RoleManager<TRole>>>(new TestLogger<RoleManager<TRole>>()); 70services.AddSingleton<ILogger<RoleManager<TRole>>>(new TestLogger<RoleManager<TRole>>()); 80protected virtual RoleManager<TRole> CreateRoleManager(object context = null, IServiceCollection services = null) 91return services.BuildServiceProvider().GetService<RoleManager<TRole>>(); 130var manager = CreateRoleManager(); 148public Task<IdentityResult> ValidateAsync(RoleManager<TRole> manager, TRole role) 166var manager = CreateRoleManager(); 182var manager = CreateRoleManager(); 200var manager = CreateRoleManager(); 217var manager = CreateRoleManager(); 234var manager = CreateRoleManager(); 273var manager = CreateRoleManager(); 287var manager = CreateRoleManager(); 303var manager = CreateRoleManager(); 322var manager = CreateRoleManager(); 345var manager = CreateRoleManager(); 364var roleManager = CreateRoleManager(context); 389var roleManager = CreateRoleManager(context); 427var roleManager = CreateRoleManager(context); 450var roleManager = CreateRoleManager(context); 480var roleMgr = CreateRoleManager(context); 500var roleMgr = CreateRoleManager(context); 521var roleMgr = CreateRoleManager(context); 539var roleMgr = CreateRoleManager(); 553var roleMgr = CreateRoleManager(); 569var roleManager = CreateRoleManager(context);
Microsoft.AspNetCore.Identity.Test (26)
IdentityBuilderTest.cs (9)
24Assert.IsType<RoleManager<PocoRole>>(sp.GetRequiredService<RoleManager<PocoRole>>()); 25Assert.NotNull(sp.GetRequiredService<RoleManager<PocoRole>>()); 50Assert.Throws<InvalidOperationException>(() => sp.GetService<RoleManager<PocoRole>>()); 154var myRoleManager = services.BuildServiceProvider().GetRequiredService<RoleManager<PocoRole>>() as MyRoleManager; 195Assert.IsType<RoleManager<PocoRole>>(provider.GetRequiredService<RoleManager<PocoRole>>()); 368public Task<IdentityResult> ValidateAsync(RoleManager<PocoRole> manager, PocoRole role) 406public MyClaimsPrincipalFactory(UserManager<PocoUser> userManager, RoleManager<PocoRole> roleManager, IOptions<IdentityOptions> optionsAccessor) : base(userManager, roleManager, optionsAccessor)
RoleManagerTest.cs (10)
20var roleManager = MockHelpers.TestRoleManager(store.Object); 40var roleManager = MockHelpers.TestRoleManager(store.Object); 53var manager = CreateRoleManager(new NoopRoleStore()); 66var manager = MockHelpers.TestRoleManager(store.Object); 83var manager = MockHelpers.TestRoleManager(store.Object); 102var manager = MockHelpers.TestRoleManager(store.Object); 115var manager = CreateRoleManager(new NoopRoleStore()); 125var manager = CreateRoleManager(new NotImplementedStore()); 136var manager = CreateRoleManager(new NoopRoleStore()); 146private static RoleManager<PocoRole> CreateRoleManager(IRoleStore<PocoRole> roleStore)
RoleValidatorTest.cs (2)
13var manager = MockHelpers.TestRoleManager<PocoRole>(); 28var manager = MockHelpers.TestRoleManager<PocoRole>();
src\Identity\test\Shared\MockHelpers.cs (3)
24public static Mock<RoleManager<TRole>> MockRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class 29return new Mock<RoleManager<TRole>>(store, roles, MockLookupNormalizer(), 54public static RoleManager<TRole> TestRoleManager<TRole>(IRoleStore<TRole> store = null) where TRole : class
UserClaimsPrincipalFactoryTest.cs (1)
16var roleManager = MockHelpers.MockRoleManager<PocoRole>().Object;
UserManagerTest.cs (1)
46Assert.Same(provider.GetRequiredService<RoleManager<PocoRole>>(),
Microsoft.Extensions.Identity.Core (15)
IdentityBuilder.cs (3)
199Services.TryAddScoped<RoleManager<TRole>>(); 251/// Adds a <see cref="RoleManager{TRole}"/> for the <see cref="RoleType"/>. 262var managerType = typeof(RoleManager<>).MakeGenericType(RoleType);
IRoleValidator.cs (2)
17/// <param name="manager">The <see cref="RoleManager{TRole}"/> managing the role store.</param> 20Task<IdentityResult> ValidateAsync(RoleManager<TRole> manager, TRole role);
RoleManager.cs (2)
31/// Constructs a new instance of <see cref="RoleManager{TRole}"/>. 42ILogger<RoleManager<TRole>> logger)
RoleValidator.cs (3)
31/// <param name="manager">The <see cref="RoleManager{TRole}"/> managing the role store.</param> 34public virtual async Task<IdentityResult> ValidateAsync(RoleManager<TRole> manager, TRole role) 46private async Task<List<IdentityError>?> ValidateRoleName(RoleManager<TRole> manager, TRole role)
UserClaimsPrincipalFactory.cs (5)
114/// <param name="roleManager">The <see cref="RoleManager{TRole}"/> to retrieve a user's roles from.</param> 116public UserClaimsPrincipalFactory(UserManager<TUser> userManager, RoleManager<TRole> roleManager, IOptions<IdentityOptions> options) 124/// Gets the <see cref="RoleManager{TRole}"/> for this factory. 127/// The current <see cref="RoleManager{TRole}"/> for this factory instance. 129public RoleManager<TRole> RoleManager { get; private set; }