示例#1
0
        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);
        }
示例#2
0
        public void TestLeaveApplicationView()
        {
            IEmployeeInfoService    employeeInfoService = new EmployeeInfoService();
            LeaveApplicationService service             = new LeaveApplicationService(employeeInfoService);

            var result = service.LeaveApplicationViews();

            Assert.AreEqual(5, result.ToList().Count);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }