public async Task <List <EmployeeHours> > GetEmployeeHours() { var callTreeProxyModelList = await _callTreeServices.GetProxyObjects(); var callTreeList = CallTreeTranslator.ToModel(callTreeProxyModelList); if (DateTime.Today.DayOfWeek == DayOfWeek.Sunday || DateTime.Today.DayOfWeek == DayOfWeek.Saturday) { _numberOfHours = 24; } List <int> employeeIdList = new List <int>(); foreach (var callTree in callTreeList) { employeeIdList.Add(callTree.Level1Employee); employeeIdList.Add(callTree.Level2Employee); employeeIdList.Add(callTree.Level3Employee); } List <int> distinctEmployeeIdList = employeeIdList.Distinct().ToList(); foreach (var employeeId in distinctEmployeeIdList) { employeeHours.Add(new EmployeeHours() { EmployeeId = employeeId, Hours = _numberOfHours }); } return(employeeHours); }
public async void Testing_CallTree_DB_Model_Return_By_CallTree_Translator_Services() { var callTreeProxyModel = await _callTreeServices.GetProxyObjects(); var callTreeDbModel = CallTreeTranslator.ToModel(callTreeProxyModel); Assert.IsType <CallTree>(callTreeDbModel[0]); }