コード例 #1
0
        protected override Week MockWeekTotest(int WeekId)
        {
            Week week = new Week();
            week.Id = WeekId;
            week.Start_Date = DateTime.Now;
            week.WorkingDays = new WorkingDays();
            for (int i = 1; i < 8; i++)
            {
                week.WorkingDays.Add(i, new WorkingDay() { Id = i, Week = WeekId });
                Shift shift = new Shift() { Id = 1, Week = WeekId, WorkingDay = i, AssignedEmployees = MockEmployeesInShift() };
                week.WorkingDays[i].Shifts.Add(1, shift);
            }

            return week;
        }
コード例 #2
0
        protected override void Establish_context()
        {
            base.Establish_context();

            _shift = new Shift();
            _shiftRuleDefinition = MockShiftRuleDefinition();
            _shiftRuleValue = MockShiftRuleValue();
            _assessor = new EmployeesInShiftAssessor(_shiftRuleValue.value);
            _shiftRule = new MinEmployeesPerShiftRule(_shiftRuleDefinition, _shiftRuleValue, _assessor, RuleType.HardRule);
            _shiftRule.Enabled = true;
        }