Exemple #1
0
        public void When_UpdateUser_Then_VerifyResult()
        {
            var userModel = TestDataHelper.GetUser().Map();
            var user      = _mockProjectManagerService.UpdateUser(userModel);

            Assert.NotNull(user);
        }
 public IHttpActionResult UpdateUser([FromBody] UserEntity entity)
 {
     if (entity.UserId > 0)
     {
         return(Ok(projectManagerService.UpdateUser(entity)));
     }
     return(Ok(false));
 }
        public IHttpActionResult UpdateUser(UserModel user)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            UserModel userModel = pmService.GetUserById(user.UserId);

            if (userModel == null)
            {
                return(BadRequest());
            }
            var result = pmService.UpdateUser(user);

            if (result != null)
            {
                return(StatusCode(HttpStatusCode.OK));
            }
            return(BadRequest());
        }