public List <Department> FetchDepartments()
 {
     try
     {
         departmentDataAccessComponent = new DepartmentDataAccessComponent();
         return(departmentDataAccessComponent.GetDepartments());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        public void GetDepartmentsPositiveTest()
        {
            var actualDepartments   = dataAccessComponent.GetDepartments();
            var expectedDepartments = new List <Department>
            {
                new Department {
                    DepartmentId = 1, DepartmentName = "HR"
                },
                new Department {
                    DepartmentId = 2, DepartmentName = "Training"
                },
                new Department {
                    DepartmentId = 4, DepartmentName = "Resources"
                }
            };

            CollectionAssert.AreEqual(expectedDepartments, actualDepartments);
        }