public async Task UpdateAsync()
        {
            //Arrange

            var moderator = await GetRoleAsync("moderator");

            var input = new IdentityRoleUpdateDto
            {
                Name             = Guid.NewGuid().ToString("N").Left(8),
                ConcurrencyStamp = moderator.ConcurrencyStamp,
                IsDefault        = moderator.IsDefault,
                IsPublic         = moderator.IsPublic
            };

            //Act

            var result = await _roleAppService.UpdateAsync(moderator.Id, input);

            //Assert

            result.Id.ShouldBe(moderator.Id);
            result.Name.ShouldBe(input.Name);

            var updatedRole = await _roleRepository.GetAsync(moderator.Id);

            updatedRole.Name.ShouldBe(input.Name);
        }
示例#2
0
 /// <summary>
 /// Updates the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="input">The input.</param>
 /// <returns>Task&lt;IdentityRoleDto&gt;.</returns>
 public virtual Task <IdentityRoleDto> Update(string id, IdentityRoleUpdateDto input)
 {
     return(_appService.UpdateAsync(id.ToGuid(), input));
 }
示例#3
0
 public virtual Task <IdentityRoleDto> UpdateAsync(Guid id, IdentityRoleUpdateDto input)
 {
     return(_roleAppService.UpdateAsync(id, input));
 }
示例#4
0
 public async Task <IdentityRoleDto> UpdateAsync(UpdateRoleInput input)
 {
     return(await _identityRoleAppService.UpdateAsync(input.RoleId, input.RoleInfo));
 }