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());
        }
Exemplo n.º 2
0
 public void Mesure_GetUserById_ThroughPutMode()
 {
     service.GetUserById(1);
     perfCounter.Increment();
 }
Exemplo n.º 3
0
        public void When_GetUserById_Then_VerifyResult()
        {
            var users = _mockProjectManagerService.GetUserById(1);

            Assert.NotNull(users);
        }
 public IHttpActionResult GetUserById(int id)
 {
     return(Ok(projectManagerService.GetUserById(id)));
 }