コード例 #1
0
 /// <summary>
 /// Ryan Blake
 /// Created: 2015/02/12
 ///
 /// Method makes a call to getEmployeeList method from the EmployeeAccessor to retrieve a list of all active employees
 /// </summary>
 /// <exception cref="Exception">Exception is thrown from Accessor that states that employee could not be found in the database</exception>
 /// <returns>The employee list is retrieved and returned up to the presentation layer (calling method)</returns>
 public List <Employee> FetchListEmployees()
 {
     try
     {
         return(EmployeeAccessor.GetEmployeeList().OrderBy(x => x.Active != true).ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
        public void EmployeeFetchEmpListAccess()
        {
            //Fetches list
            List <Employee> myList = new List <Employee>();

            myList = EmployeeAccessor.GetEmployeeList();
            bool worked = false;

            //Tests that a list greater than one is being returned.
            if (myList.Count > 1)
            {
                worked = true;
            }
            Assert.IsTrue(worked);
        }