public void TestLeaveApplicationView_2LeaveDays() { IEmployeeInfoService employeeInfoService = new EmployeeInfoService(); LeaveApplicationService service = new LeaveApplicationService(employeeInfoService); var result = service.LeaveApplicationViews(); Assert.AreEqual(3, result.First(x => x.EmpNo == 1).LeaveDays); }
public void TestLeaveApplicationView() { IEmployeeInfoService employeeInfoService = new EmployeeInfoService(); LeaveApplicationService service = new LeaveApplicationService(employeeInfoService); var result = service.LeaveApplicationViews(); Assert.AreEqual(5, result.ToList().Count); }
public void TestLeaveApplicationView_1LeaveDay() { IEmployeeInfoService employeeInfoService = new EmployeeInfoService(); LeaveApplicationService service = new LeaveApplicationService(employeeInfoService); var result = service.LeaveApplicationViews(); var leaveApplication = result.First(x => x.EmpNo == 4 && x.EndDate.Equals(x.StartDate)); Assert.AreEqual(1, leaveApplication.LeaveDays); }
public void TestLeaveApplicationView_TotalLeaveDays() { IEmployeeInfoService employeeInfoService = new EmployeeInfoService(); LeaveApplicationService service = new LeaveApplicationService(employeeInfoService); var result = service.LeaveApplicationViews(); var totalLeaves = result.Where(x => x.EmpNo == 4).Select(x => x.LeaveDays).DefaultIfEmpty(0).Sum(); Assert.AreEqual(4, totalLeaves); }