Exemple #1
0
 public ApplicationRole Put(string id, [FromBody] ApplicationRole role)
 {
     role.Id = id;
     foreach (var claim in role.RoleClaims)
     {
         claim.RoleId = role.Id;
     }
     role = _securityService.UpdateRole(role);
     return(role);
 }
Exemple #2
0
        public void UpdateRoles_Alway_valid()
        {
            var roleModel = new Role()
            {
                Id   = Guid.NewGuid(),
                Name = "admin",
            };

            _roleRepository.Update(Arg.Any <Role>());

            // Execute
            _sut.UpdateRole(roleModel);

            // Assert
            _roleRepository.Received(1).Update(Arg.Any <Role>());
        }