Exemplo n.º 1
0
        public void When_AddUser_Then_VerifyResult()
        {
            var userModel = TestDataHelper.GetUser().Map();
            var user      = _mockProjectManagerService.AddUser(userModel);

            Assert.NotNull(user);
        }
        public IHttpActionResult AddUser(UserModel user)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

            if (result != null)
            {
                return(Ok());
            }
            return(BadRequest());
        }
 public IHttpActionResult CreateUser([FromBody] UserEntity entity)
 {
     return(Ok(projectManagerService.AddUser(entity)));
 }