Пример #1
0
        public async Task <IActionResult> Update([FromBody] UpdateUserGroupCommand updateUserGroup)
        {
            var result = await Mediator.Send(updateUserGroup);

            if (result.Success)
            {
                return(Ok(result.Message));
            }
            return(BadRequest(result.Message));
        }
Пример #2
0
        public void Handler_UpdateUserGroup()
        {
            var updateUserCommand = new UpdateUserGroupCommand();

            updateUserCommand.GroupId = 1;
            updateUserCommand.UserId  = 1;

            var result = updateUserGroupCommandHandler.
                         Handle(updateUserCommand, new System.Threading.CancellationToken()).Result;

            Assert.That(result.Success, Is.True);
        }
Пример #3
0
        public void Handler_UpdateUserGroup()
        {
            var updateUserCommand = new UpdateUserGroupCommand();

            updateUserCommand.GroupId = new int[] { 1 };
            updateUserCommand.UserId  = 1;

            var result = _updateUserGroupCommandHandler.
                         Handle(updateUserCommand, new System.Threading.CancellationToken()).Result;

            result.Success.Should().BeTrue();
        }
 public async Task <IActionResult> Update([FromBody] UpdateUserGroupCommand updateUserGroup)
 {
     return(GetResponseOnlyResultMessage(await Mediator.Send(updateUserGroup)));
 }