예제 #1
0
        public async Task RoleStore_create_update()
        {
            var role = _roleTestFactory.CreateRole();
            await _roleStore.CreateAsync(role, default(CancellationToken));

            await _roleStore.SetNormalizedRoleNameAsync(role, role.Name, default(CancellationToken));

            var fetchedRole = await _roleStore.FindByNameAsync(role.Name, default(CancellationToken));

            role.Name.ShouldMatch(fetchedRole.Name);

            await _roleStore.SetRoleNameAsync(role, "dog", default(CancellationToken));

            await _roleStore.SetNormalizedRoleNameAsync(role, role.Name, default(CancellationToken));

            await _roleStore.UpdateAsync(role, default(CancellationToken));

            fetchedRole = await _roleStore.FindByNameAsync(role.Name, default(CancellationToken));

            role.Name.ShouldMatch(fetchedRole.Name);
        }
예제 #2
0
 public async Task <IdentityResult> UpdateAsync(ApplicationRole role, CancellationToken cancellationToken)
 {
     return(await roleStore.UpdateAsync(role, cancellationToken));
 }