Exemple #1
0
        public void When_UpdateProject_Then_VerifyResult()
        {
            var projectModel = TestDataHelper.GetProject().Map();
            var project      = _mockProjectManagerService.UpdateProject(projectModel);

            Assert.NotNull(project);
        }
 public IHttpActionResult UpdateProject([FromBody] ProjectEntity entity)
 {
     if (entity.ProjectId > 0)
     {
         return(Ok(projectManagerService.UpdateProject(entity)));
     }
     return(Ok(false));
 }
        public IHttpActionResult UpdateProject(ProjectModel project)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            //UserModel userModel = pmService.GetUserById(user.UserId);
            //if (userModel == null)
            //{
            //    return BadRequest();
            //}
            var result = pmService.UpdateProject(project);

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