public void GetAllEmployeesTest() { var repo = new TimeTrackerRepository(); List <Employee> allEmployees = repo.GetAllEmployees(); Assert.AreEqual(14, allEmployees.Count); }
public Response <List <Employee> > GetAllEmployees() { TimeTrackerRepository repo = new TimeTrackerRepository(); var response = new Response <List <Employee> >(); List <Employee> listOfEmployees = repo.GetAllEmployees(); try { if (listOfEmployees.Count > 0) { response.Success = true; response.Data = listOfEmployees; } else { response.Success = false; response.Message = "There were no employees found"; } } catch (Exception ex) { response.Success = false; response.Message = ex.Message; } return(response); }