public BaseServiceMessage AddAttendanceLog(List <AttendanceLogItem> logs) { AttendanceLogRepository _attendanceLogRepository = new AttendanceLogRepository(); List <DbContextFiles.EmployeeAttendance> attendanceLogs = new List <DbContextFiles.EmployeeAttendance>(); foreach (var l in logs) { DbContextFiles.EmployeeAttendance employeeAttendance = new DbContextFiles.EmployeeAttendance(); // get logs for this employee List <DbContextFiles.EmployeeAttendance> employeeAttendances = _attendanceLogRepository.GetLogs(l.EmployeeId, l.DateAttended); if (employeeAttendances != null) { if (employeeAttendances.Count > 0) { continue; } } // if here then no existing logs and add a log employeeAttendance.AttendanceDate = l.DateAttended; employeeAttendance.EmployeeId = l.EmployeeId; employeeAttendance.DateAddedOnUtc = DateTime.UtcNow; employeeAttendance.IsDeleted = false; employeeAttendance.AttendanceStatusId = l.SelectedStatus.AttendanceStatusId; attendanceLogs.Add(employeeAttendance); } // add logs and save if (attendanceLogs.Count > 0) { _attendanceLogRepository.AddAttendanceLog(attendanceLogs); bool DbResponse = _attendanceLogRepository.SaveDbChanges(); if (DbResponse) { return new BaseServiceMessage() { WasSuccess = DbResponse, Message = "Successfully Save Attendance Entries" } } ; return(new BaseServiceMessage() { WasSuccess = DbResponse, Message = "There was an error when trying to save attendance entries to the Db " }); } return(new BaseServiceMessage() { WasSuccess = false, Message = "Looks like there was already entries save in the Db for those dates" }); }
public StatisticsService() { smoONEContext = new SmoONEDbContext(); _unitOfWork = new UnitOfWork(smoONEContext); _AT_CustomDateRepository = new AT_CustomDateRepository(smoONEContext); _AttendanceLogRepository = new AttendanceLogRepository(smoONEContext); _AttendanceTemplateRepository = new AttendanceTemplateRepository(smoONEContext); _attendanceSchedulingRepository = new AttendanceSchedulingRepository(smoONEContext); _monthlyStatisticsRepository = new MonthlyStatisticsRepository(smoONEContext); _dailyStatisticsRepository = new DailyStatisticsRepository(smoONEContext); _AT_UserLogRepository = new AT_UserLogRepository(smoONEContext); _monthlyResultRepository = new MonthlyResultRepository(smoONEContext); InitializeComponent(); }
public void GetAttendanceHoursByDateTest() { var databaseFactory = new DatabaseFactory(); var unitOfWork = new UnitOfWork(databaseFactory); var employeeDepartmentRepository = new EmployeeDepartmentRepository(databaseFactory); var employeeRepository = new EmployeeRepository(databaseFactory, employeeDepartmentRepository); var attendanceLogRepository = new AttendanceLogRepository(databaseFactory, employeeRepository); var employeeHoursRepository = new EmployeeHoursRepository(databaseFactory); var attendanceRepository = new AttendanceRepository(databaseFactory); var attendanceLogService = new AttendanceLogService(attendanceLogRepository); var attendanceService = new AttendanceService(unitOfWork, attendanceRepository, attendanceLogService, employeeHoursRepository); var result = attendanceService.GetAttendanceAndHoursByDate(new DateTime(2016, 6, 8), new DateTime(2016, 6, 8), 0); }
public void GetAttendanceWithName() { //This will connect to database not mock data //Arrange var payrollContext = new PayrollContext(); var databaseFactory = new DatabaseFactory(payrollContext); var employeeDepartmentRepository = new EmployeeDepartmentRepository(databaseFactory); var employeeRepository = new EmployeeRepository(databaseFactory, employeeDepartmentRepository); var attendanceLogRepository = new AttendanceLogRepository(databaseFactory, employeeRepository); var startDate = new DateTime(2016, 03, 06); var endDate = new DateTime(2016, 03, 07); //Act var result = attendanceLogRepository.GetAttendanceLogsWithName(startDate, endDate, 0); //Assert Assert.IsNotNull(result); }
public List <AttendanceLogItem> GetAttendanceHistory() { List <AttendanceLogItem> logs = new List <AttendanceLogItem>(); AttendanceLogRepository _attendanceLogRepository = new AttendanceLogRepository(); List <DbContextFiles.EmployeeAttendance> employeeAttendances = _attendanceLogRepository.GetLogs(100); employeeAttendances.ForEach(x => logs.Add(new AttendanceLogItem() { AttendanceLogItemId = x.EmployeeAttendanceId, EmployeeName = x.Employee.Firstname + " " + x.Employee.Surname, DateAttended = x.AttendanceDate, AttendanceStatusLabel = x.AttendanceStatu.Status, SelectedStatus = new AttendanceStatusDto() { AttendanceStatusId = x.AttendanceStatu.AttendanceStatusId, AttendanceStatusLabel = x.AttendanceStatu.Status } })); return(logs); }
public BaseServiceMessage UpdateAttendanceLog(int logId, int attendanceStatusId) { AttendanceLogRepository _attendanceLogRepository = new AttendanceLogRepository(); bool response = _attendanceLogRepository.UpdateAttendanceLogStatus(logId, attendanceStatusId); if (response) { bool didsave = _attendanceLogRepository.SaveDbChanges(); if (didsave) { return(new BaseServiceMessage() { Message = "Updated Successfully", WasSuccess = true }); } } return(new BaseServiceMessage() { Message = "There was a problem trying to update the log, contact dev@", WasSuccess = false }); }
//Scenarios // * Last login is not within the date range // * Last login within date range public void CreateWorkSchedulesByDateRange() { //Arrange var databaseFactory = new DatabaseFactory(); var unitOfWork = new UnitOfWork(databaseFactory); var employeeDepartmentRepository = new EmployeeDepartmentRepository(databaseFactory); var employeeRepository = new EmployeeRepository(databaseFactory, employeeDepartmentRepository); var attendanceLogRepository = new AttendanceLogRepository(databaseFactory, employeeRepository); var employeeHoursRepository = new EmployeeHoursRepository(databaseFactory); var attendanceRepository = new AttendanceRepository(databaseFactory); var attendanceLogService = new AttendanceLogService(attendanceLogRepository); var attendanceService = new AttendanceService(unitOfWork, attendanceRepository, attendanceLogService, employeeHoursRepository); //Delete Data employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE attendance"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE attendance_log"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE employee_hours"); employeeRepository.ExecuteSqlCommand("SET FOREIGN_KEY_CHECKS = 0"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE employee"); employeeRepository.ExecuteSqlCommand("SET FOREIGN_KEY_CHECKS = 1"); //Add employee var employee1 = new Employee { EmployeeId = 1, EmployeeCode = "11001", FirstName = "Jona", LastName = "Pereira", MiddleName = "Aprecio", BirthDate = DateTime.Parse("02/02/1991"), Gender = 1, IsActive = true }; var employee2 = new Employee { EmployeeId = 2, EmployeeCode = "11002", FirstName = "Jona", LastName = "Pereira", MiddleName = "Aprecio", BirthDate = DateTime.Parse("02/02/1991"), Gender = 1, IsActive = true }; var employee3 = new Employee { EmployeeId = 3, EmployeeCode = "11003", FirstName = "Jona", LastName = "Pereira", MiddleName = "Aprecio", BirthDate = DateTime.Parse("02/02/1991"), Gender = 1, IsActive = true }; //Insert employee employeeRepository.Add(employee1); employeeRepository.Add(employee2); employeeRepository.Add(employee3); var dataAttendanceLog = new List <AttendanceLog> { // Will not be considered new AttendanceLog() { EmployeeId = employee1.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 00:00:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, // Employee 2 log in new AttendanceLog() { EmployeeId = employee2.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 07:00:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, // Employee 1 Logout new AttendanceLog { EmployeeId = employee1.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 04:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, // Employee 2 Clockout new AttendanceLog { EmployeeId = employee2.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 12:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, //Employee 3 login new AttendanceLog { EmployeeId = employee3.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 07:00:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, // Employee 2 login new AttendanceLog { EmployeeId = employee2.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 13:00:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, // Employee 3 logout new AttendanceLog { EmployeeId = employee3.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 18:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, // Employee 2 logout new AttendanceLog { EmployeeId = employee2.EmployeeId, ClockInOut = DateTime.Parse("2016-02-02 18:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, // Will not be considered new AttendanceLog { EmployeeId = employee3.EmployeeId, ClockInOut = DateTime.Parse("2016-02-03 00:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false } }; var dataAttendance = new List <Attendance> { new Attendance() { Employee = employee1, ClockIn = DateTime.Parse("2016-02-01 23:00:00"), ClockOut = null, IsManuallyEdited = false }, new Attendance() { Employee = employee2, ClockIn = DateTime.Parse("2016-02-01 23:30:00"), ClockOut = DateTime.Parse("2016-02-01 23:55:00"), IsManuallyEdited = false } }; //Save test info foreach (var attendanceLog in dataAttendanceLog) { attendanceLogRepository.Add(attendanceLog); unitOfWork.Commit(); } foreach (var attendance in dataAttendance) { attendanceRepository.Add(attendance); unitOfWork.Commit(); } var dateFrom = DateTime.Parse("2016-02-02 00:00:00"); var dateTo = DateTime.Parse("2016-02-03 00:00:00"); attendanceService.CreateWorkSchedules(); // unitOfWork.Commit(); var attendanceListEmployee1 = attendanceService.GetAttendanceByDateRange(employee1.EmployeeId, dateFrom, dateTo); Assert.AreEqual(1, attendanceListEmployee1.Count()); Assert.AreEqual(DateTime.Parse("2016-02-01 23:00:00"), attendanceListEmployee1[0].ClockIn); Assert.AreEqual(DateTime.Parse("2016-02-02 04:00:00"), attendanceListEmployee1[0].ClockOut); var attendanceListEmployee2 = attendanceService.GetAttendanceByDateRange(employee2.EmployeeId, dateFrom, dateTo); Assert.AreEqual(2, attendanceListEmployee2.Count()); Assert.AreEqual(DateTime.Parse("2016-02-02 07:00:00"), attendanceListEmployee2[0].ClockIn); Assert.AreEqual(DateTime.Parse("2016-02-02 12:00:00"), attendanceListEmployee2[0].ClockOut); Assert.AreEqual(DateTime.Parse("2016-02-02 13:00:00"), attendanceListEmployee2[1].ClockIn); Assert.AreEqual(DateTime.Parse("2016-02-02 18:00:00"), attendanceListEmployee2[1].ClockOut); var attendanceListEmployee3 = attendanceService.GetAttendanceByDateRange(employee3.EmployeeId, dateFrom, dateTo); Assert.AreEqual(1, attendanceListEmployee3.Count()); Assert.AreEqual(DateTime.Parse("2016-02-02 07:00:00"), attendanceListEmployee3[0].ClockIn); Assert.AreEqual(DateTime.Parse("2016-02-02 18:00:00"), attendanceListEmployee3[0].ClockOut); }
public void GetAttendanceLogs() { var data = new List <AttendanceLog> { new AttendanceLog() { AttendanceLogId = 1, EmployeeId = 1, ClockInOut = DateTime.Parse("2016-02-02 06:50:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 2, EmployeeId = 1, ClockInOut = DateTime.Parse("2016-02-02 06:51:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 3, EmployeeId = 2, ClockInOut = DateTime.Parse("2016-02-02 06:51:05"), Type = AttendanceType.ClockIn, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 4, EmployeeId = 2, ClockInOut = DateTime.Parse("2016-02-02 18:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 5, EmployeeId = 2, ClockInOut = DateTime.Parse("2016-02-02 18:05:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 6, EmployeeId = 1, ClockInOut = DateTime.Parse("2016-02-02 18:10:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 7, EmployeeId = 3, ClockInOut = DateTime.Parse("2016-02-02 23:59:59"), Type = AttendanceType.ClockIn, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 8, EmployeeId = 3, ClockInOut = DateTime.Parse("2016-02-03 00:00:00"), Type = AttendanceType.ClockIn, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 9, EmployeeId = 3, ClockInOut = DateTime.Parse("2016-02-02 00:00:00"), Type = AttendanceType.ClockOut, IsRecorded = false }, new AttendanceLog { AttendanceLogId = 10, EmployeeId = 3, ClockInOut = DateTime.Parse("2016-02-02 01:00:00"), Type = AttendanceType.ClockOut, IsRecorded = true } }.AsQueryable(); var dbSetAttendanceLogMock = new Mock <IDbSet <AttendanceLog> >(); dbSetAttendanceLogMock.Setup(m => m.Provider).Returns(data.Provider); dbSetAttendanceLogMock.Setup(m => m.Expression).Returns(data.Expression); dbSetAttendanceLogMock.Setup(m => m.ElementType).Returns(data.ElementType); dbSetAttendanceLogMock.Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var context = new Mock <PayrollContext>(); context.Setup(x => x.AttendanceLog).Returns(dbSetAttendanceLogMock.Object); context.Object.SaveChanges(); var databaseFactory = new DatabaseFactory(context.Object); var employeeDepartmentRepository = new EmployeeDepartmentRepository(databaseFactory); var employeeRepository = new EmployeeRepository(databaseFactory, employeeDepartmentRepository); var attendanceLogRepository = new AttendanceLogRepository(databaseFactory, employeeRepository); var fromDate = DateTime.Parse("2016-02-02 00:00:00"); var toDate = DateTime.Parse("2016-02-03 00:00:00"); var attendanceLogs = attendanceLogRepository.GetAttendanceLogs(fromDate, toDate, false); Assert.IsNotNull(attendanceLogs); Assert.AreEqual(attendanceLogs.Count, 8); Assert.AreEqual(attendanceLogs[0].AttendanceLogId, 1); Assert.AreEqual(attendanceLogs[1].AttendanceLogId, 2); Assert.AreEqual(attendanceLogs[2].AttendanceLogId, 6); Assert.AreEqual(attendanceLogs[3].AttendanceLogId, 3); Assert.AreEqual(attendanceLogs[4].AttendanceLogId, 4); Assert.AreEqual(attendanceLogs[5].AttendanceLogId, 5); Assert.AreEqual(attendanceLogs[6].AttendanceLogId, 9); Assert.AreEqual(attendanceLogs[7].AttendanceLogId, 7); }
public void GenerateTotalByDateRangeMinimumOT() { //Arrange var databaseFactory = new DatabaseFactory(); var unitOfWork = new UnitOfWork(databaseFactory); var employeeHoursRepository = new EmployeeHoursRepository(databaseFactory); var totalEmployeeHoursRepository = new TotalEmployeeHoursRepository(databaseFactory); var employeeDepartmentRepository = new EmployeeDepartmentRepository(databaseFactory); var employeeRepository = new EmployeeRepository(databaseFactory, employeeDepartmentRepository); var attendanceRepository = new AttendanceRepository(databaseFactory); var attendanceLogRepository = new AttendanceLogRepository(databaseFactory, employeeRepository); var settingRepository = new SettingRepository(databaseFactory); var employeeWorkScheduleRepository = new EmployeeWorkScheduleRepository(databaseFactory); var employeeInfoRepository = new EmployeeInfoRepository(databaseFactory); var employeeInfoService = new EmployeeInfoService(employeeInfoRepository); var attendanceLogService = new AttendanceLogService(attendanceLogRepository); var attendanceService = new AttendanceService(unitOfWork, attendanceRepository, attendanceLogService, employeeHoursRepository); var settingService = new SettingService(settingRepository); var employeeWorkScheduleService = new EmployeeWorkScheduleService(employeeWorkScheduleRepository); var employeeHoursService = new EmployeeHoursService(unitOfWork, employeeHoursRepository, attendanceService, settingService, employeeWorkScheduleService, employeeInfoService); var totalEmployeeHoursService = new TotalEmployeeHoursService(unitOfWork, totalEmployeeHoursRepository, employeeHoursService, settingService); //Delete info employeeRepository.ExecuteSqlCommand("SET FOREIGN_KEY_CHECKS = 0"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE employee_hours"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE employee_hours_total"); employeeRepository.ExecuteSqlCommand("TRUNCATE TABLE employee"); employeeRepository.ExecuteSqlCommand("SET FOREIGN_KEY_CHECKS = 1"); unitOfWork.Commit(); var employee1 = new Employee { EmployeeCode = "11001", FirstName = "Jona", LastName = "Pereira", MiddleName = "Aprecio", BirthDate = DateTime.Parse("02/02/1991"), Gender = 1, IsActive = true }; var employee2 = new Employee { EmployeeCode = "11001", FirstName = "Jona", LastName = "Pereira", MiddleName = "Aprecio", BirthDate = DateTime.Parse("02/02/1991"), Gender = 1, IsActive = true }; //var paymentFrequencyId = 1; var employeeInfo1 = new EmployeeInfo { Employee = employee1, SalaryFrequency = FrequencyType.Hourly, //PaymentFrequencyId = paymentFrequencyId }; var employeeInfo2 = new EmployeeInfo { Employee = employee2, SalaryFrequency = FrequencyType.Hourly, //PaymentFrequencyId = paymentFrequencyId }; employeeInfoRepository.Add(employeeInfo1); employeeInfoRepository.Add(employeeInfo2); /* "03/01/2016 - Employee 1 Regular Total hour 8 */ var employeeHours1 = new EmployeeHours { Date = DateTime.Parse("03/01/2016"), Employee = employee1, Hours = 4.1, OriginAttendanceId = 1, Type = Entities.Enums.RateType.Regular }; var employeeHours3 = new EmployeeHours { Date = DateTime.Parse("03/01/2016"), Employee = employee1, Hours = 4, OriginAttendanceId = 3, Type = Entities.Enums.RateType.Regular }; /* 03/01/2016 - Employee 1 OT Total hour 3 */ var employeeHours4 = new EmployeeHours { Date = DateTime.Parse("03/01/2016"), Employee = employee1, Hours = 3.05, OriginAttendanceId = 3, Type = Entities.Enums.RateType.OverTime }; /* 03/01/2016 - Employee 1 ND Total hour 1 */ var employeeHours5 = new EmployeeHours { Date = DateTime.Parse("03/01/2016"), Employee = employee1, Hours = 1.06, OriginAttendanceId = 3, Type = Entities.Enums.RateType.NightDifferential }; /* 03/01/2016 - Employee 2 OT Total hour 3 */ var employeeHours2 = new EmployeeHours { Date = DateTime.Parse("03/01/2016"), Employee = employee2, Hours = 3.07, OriginAttendanceId = 2, Type = Entities.Enums.RateType.OverTime }; /* 03/02/2016 - Employee 1 OT Total hour 1 */ var employeeHours8 = new EmployeeHours { Date = DateTime.Parse("03/02/2016"), Employee = employee1, Hours = 1.08, OriginAttendanceId = 5, Type = Entities.Enums.RateType.OverTime }; /* 03/02/2016 - Employee 2 Regular Total hour 4.09 */ var employeeHours6 = new EmployeeHours { Date = DateTime.Parse("03/02/2016"), Employee = employee2, Hours = 4.09, OriginAttendanceId = 4, Type = Entities.Enums.RateType.Regular }; /* 03/02/2016 - Employee 2 NightDifferential Total hour 6.5 */ var employeeHours7 = new EmployeeHours { Date = DateTime.Parse("03/02/2016"), Employee = employee2, Hours = 4, OriginAttendanceId = 4, Type = Entities.Enums.RateType.NightDifferential }; var employeeHours10 = new EmployeeHours { Date = DateTime.Parse("03/02/2016"), Employee = employee2, Hours = 2.5, OriginAttendanceId = 4, Type = Entities.Enums.RateType.NightDifferential }; /* NOT INCLUDED */ var employeeHours9 = new EmployeeHours { Date = DateTime.Parse("03/03/2016"), Employee = employee1, Hours = 10, OriginAttendanceId = 5, Type = Entities.Enums.RateType.OverTime }; employeeHoursRepository.Add(employeeHours1); employeeHoursRepository.Add(employeeHours2); employeeHoursRepository.Add(employeeHours3); employeeHoursRepository.Add(employeeHours4); employeeHoursRepository.Add(employeeHours5); employeeHoursRepository.Add(employeeHours6); employeeHoursRepository.Add(employeeHours7); employeeHoursRepository.Add(employeeHours8); employeeHoursRepository.Add(employeeHours9); employeeHoursRepository.Add(employeeHours10); //Existing total employee hours var totalEmployeeHours1 = new TotalEmployeeHours { EmployeeId = 1, Date = DateTime.Parse("03/01/2016"), Type = Entities.Enums.RateType.OverTime, Hours = 2 }; var totalEmployeeHours2 = new TotalEmployeeHours { EmployeeId = 2, Date = DateTime.Parse("03/02/2016"), Type = Entities.Enums.RateType.NightDifferential, Hours = 4 }; var totalEmployeeHours3 = new TotalEmployeeHours { EmployeeId = 2, Date = DateTime.Parse("03/01/2016"), Type = Entities.Enums.RateType.Regular, Hours = 8 }; totalEmployeeHoursRepository.Add(totalEmployeeHours1); totalEmployeeHoursRepository.Add(totalEmployeeHours2); totalEmployeeHoursRepository.Add(totalEmployeeHours3); unitOfWork.Commit(); DateTime dateFrom = DateTime.Parse("03/01/2016"); DateTime dateTo = DateTime.Parse("03/02/2016"); totalEmployeeHoursService.GenerateTotalByDateRange(dateFrom, dateTo); var totalEmployeeHours = totalEmployeeHoursService.GetByDateRange(dateFrom, dateTo); Assert.AreEqual(7, totalEmployeeHours.Count()); Assert.AreEqual(1, totalEmployeeHours[0].EmployeeId); Assert.AreEqual(DateTime.Parse("03/02/2016"), totalEmployeeHours[0].Date); Assert.AreEqual(Entities.Enums.RateType.OverTime, totalEmployeeHours[0].Type); Assert.AreEqual(1.08, totalEmployeeHours[0].Hours); Assert.AreEqual(2, totalEmployeeHours[1].EmployeeId); Assert.AreEqual(DateTime.Parse("03/02/2016"), totalEmployeeHours[1].Date); Assert.AreEqual(Entities.Enums.RateType.Regular, totalEmployeeHours[1].Type); Assert.AreEqual(4.09, totalEmployeeHours[1].Hours); Assert.AreEqual(2, totalEmployeeHours[2].EmployeeId); Assert.AreEqual(DateTime.Parse("03/02/2016"), totalEmployeeHours[2].Date); Assert.AreEqual(Entities.Enums.RateType.NightDifferential, totalEmployeeHours[2].Type); Assert.AreEqual(6.5, totalEmployeeHours[2].Hours); Assert.AreEqual(1, totalEmployeeHours[3].EmployeeId); Assert.AreEqual(DateTime.Parse("03/01/2016"), totalEmployeeHours[3].Date); Assert.AreEqual(Entities.Enums.RateType.Regular, totalEmployeeHours[3].Type); Assert.AreEqual(8.1, totalEmployeeHours[3].Hours); Assert.AreEqual(1, totalEmployeeHours[4].EmployeeId); Assert.AreEqual(DateTime.Parse("03/01/2016"), totalEmployeeHours[4].Date); Assert.AreEqual(Entities.Enums.RateType.OverTime, totalEmployeeHours[4].Type); Assert.AreEqual(3.05, totalEmployeeHours[4].Hours); Assert.AreEqual(1, totalEmployeeHours[5].EmployeeId); Assert.AreEqual(DateTime.Parse("03/01/2016"), totalEmployeeHours[5].Date); Assert.AreEqual(Entities.Enums.RateType.NightDifferential, totalEmployeeHours[5].Type); Assert.AreEqual(1.06, totalEmployeeHours[5].Hours); /*Assert.AreEqual(2, totalEmployeeHours[6].EmployeeId); * Assert.AreEqual(DateTime.Parse("03/01/2016"), totalEmployeeHours[6].Date); * Assert.AreEqual(Entities.Enums.RateType.Regular, totalEmployeeHours[6].Type); * Assert.AreEqual(8, totalEmployeeHours[6].Hours);*/ Assert.AreEqual(2, totalEmployeeHours[6].EmployeeId); Assert.AreEqual(DateTime.Parse("03/01/2016"), totalEmployeeHours[6].Date); Assert.AreEqual(Entities.Enums.RateType.OverTime, totalEmployeeHours[6].Type); Assert.AreEqual(3.07, totalEmployeeHours[6].Hours); Assert.AreEqual(true, employeeHours1.IsIncludedInTotal); Assert.AreEqual(true, employeeHours2.IsIncludedInTotal); Assert.AreEqual(true, employeeHours3.IsIncludedInTotal); Assert.AreEqual(true, employeeHours4.IsIncludedInTotal); Assert.AreEqual(true, employeeHours5.IsIncludedInTotal); Assert.AreEqual(true, employeeHours6.IsIncludedInTotal); Assert.AreEqual(true, employeeHours7.IsIncludedInTotal); Assert.AreEqual(true, employeeHours8.IsIncludedInTotal); Assert.AreEqual(false, employeeHours9.IsIncludedInTotal); }