// POST: api/TaskManager public void AddProject([FromBody] Project project) { ProjectManagerBL taskManagerBL = new ProjectManagerBL(); taskManagerBL.AddProject(new DA.Project() { Project1 = project.Name, Priority = project.Priority, End_Date = Convert.ToDateTime(project.EndDate), Start_Date = Convert.ToDateTime(project.StartDate) }); }
public void TestMethod6_AddProject() { ProjectModel projM = new ProjectModel() { ProjectName = "GICR", ProjectID = 101, NoOfTasks = 5, CompletedTasks = 1, StartDate = DateTime.Now, EndDate = DateTime.Now, Priority = 20 }; Mock <IProjectDbService> mock = new Mock <IProjectDbService>(); ProjectManagerBL projBL = new ProjectManagerBL(mock.Object); projBL.AddProject(projM); mock.Verify(c => c.AddProject(It.IsAny <Project>()), Times.Once); }
public void AddProjectTest() { Projects newProject = new Projects() { ProjectId = 4, ProjectName = "MEDICAL", StartDate = new DateTime(), EndDate = new DateTime(), ManagerId = 1, Priority = 13, IsSuspended = false }; ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); string result = tb.AddProject(newProject); Assert.AreEqual(result, "Project Added Successfully"); Projects confirmResult = tb.GetProjectById(4); Assert.AreEqual(confirmResult, newProject); }
public IHttpActionResult AddProject(Projects project) { ProjectManagerBL obj = new ProjectManagerBL(_db); return(Ok(obj.AddProject(project))); }