public async Task UpdateProjectAssignmentSuccessful()
        {
            var request = new UpdateProjectAssignmentCommand()
            {
                UserId      = Utilities.User3.Id,
                ProjectId   = Utilities.Project1.Id,
                MemberType  = ProjectMemberType.Tester.ToString(),
                ProjectRole = ProjectRole.SuperMember.ToString()
            };

            var response = await Client.PutAsync("/api/ProjectAssignments", Utilities.GetRequestContent(request));

            response.EnsureSuccessStatusCode();
        }
Exemplo n.º 2
0
        public async Task <ActionResult> UpdateProjectAssignment([FromBody] UpdateProjectAssignmentCommand command)
        {
            try
            {
                await Mediator.Send(command);

                return(Ok());
            }
            catch (UnauthorizedException e)
            {
                return(StatusCode(401, e.Message));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }