public void DepartmentServiceConstructorTest() { IEmpDBContext departmentDBContext = null; // TODO: Initialize to an appropriate value DepartmentService target = new DepartmentService(departmentDBContext); Assert.Inconclusive("TODO: Implement code to verify target"); }
public void getAllDepartmentsTest() { DepartmentService target = new DepartmentService(dbContext); // TODO: Initialize to an appropriate value Department expected1 = new Department(); expected1.DepartmentID = 1; expected1.Name = "Alabama"; dbContext.Departments.Add(expected1); Department expected2 = new Department(); expected2.DepartmentID = 2; expected2.Name = "Alaska"; dbContext.Departments.Add(expected2); List<Department> expected = new List<Department>(); // TODO: Initialize to an appropriate value expected.Add(expected1); expected.Add(expected2); List<Department> actual; actual = target.getAllDepartments(); Assert.AreEqual(expected.Count, actual.Count); Assert.AreEqual(expected[0].DepartmentID, actual[0].DepartmentID); Assert.AreEqual(expected[1].Name, actual[1].Name); dbContext.Departments.Remove(expected1); dbContext.Departments.Remove(expected2); }
public void getDepartmentTest() { DepartmentService target = new DepartmentService(dbContext); // TODO: Initialize to an appropriate value Department expected = new Department(); expected.DepartmentID = 1; expected.Name = "Alabama"; dbContext.Departments.Add(expected); dbContext.SaveChanges(); Department actual; actual = target.getDepartment(expected.DepartmentID); Assert.AreEqual(expected, actual); dbContext.Departments.Remove(expected); }