public IHttpActionResult AddProject(ProjectModel project)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ProjectModel proj = pmService.GetProjectById(project.ProjectId);

            if (proj != null)
            {
                return(BadRequest());
            }
            var result = pmService.AddProject(project);

            if (result != null)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Exemple #2
0
        public void When_GetProjectById_Then_VerifyResult()
        {
            var projects = _mockProjectManagerService.GetProjectById(1);

            Assert.NotNull(projects);
        }
 public IHttpActionResult GetProjectById(int id)
 {
     return(Ok(projectManagerService.GetProjectById(id)));
 }