Beispiel #1
0
        public void When_AddProject_Then_VerifyResult()
        {
            var projectModel = TestDataHelper.GetProject().Map();
            var project      = _mockProjectManagerService.AddProject(projectModel);

            Assert.NotNull(project);
        }
        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());
        }
 public IHttpActionResult CreateProject([FromBody] ProjectEntity entity)
 {
     return(Ok(projectManagerService.AddProject(entity)));
 }