public void GetProjectByIdTest() { ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); Projects result = tb.GetProjectById(1); Assert.AreEqual(result.ProjectId, 1); }
public void SuspendProjectTest() { ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); string result = tb.SuspendProject(1); dbContext.Verify(x => x.SaveChanges()); Assert.AreEqual(result, "Project Suspended Successfully"); Projects confirmResult = tb.GetProjectById(1); Assert.AreEqual(confirmResult.IsSuspended, true); }
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 void UpdateProjectTest() { Projects newProject = new Projects() { ProjectId = 3, ProjectName = "BANKING", StartDate = new DateTime(), EndDate = new DateTime(), ManagerId = 3, Priority = 15, IsSuspended = true }; ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); string result = tb.UpdateProject(newProject); dbContext.Verify(x => x.SaveChanges()); Assert.AreEqual(result, "Project Updated Successfully"); Projects confirmResult = tb.GetProjectById(3); Assert.AreEqual(confirmResult.ProjectName, newProject.ProjectName); }
public IHttpActionResult GetProject(int id) { ProjectManagerBL obj = new ProjectManagerBL(_db); return(Ok(obj.GetProjectById(id))); }
public Projectset GetProjectById(int id) { return(pbl.GetProjectById(id));; }