コード例 #1
0
        public void GetScheduledDays_Period2_twoDays()
        {
            WashingDayDefinition wd = new WashingDayDefinition();
            AlarmController      ac = new AlarmController(null, null, null);

            WashingDayEditorController wdc = new WashingDayEditorController(wd, allRoutines, ac);

            wdc.GetModel().Scheduled.WeeklyPeriod.WeekDays = new System.Collections.Generic.List <DayOfWeek>
            {
                DayOfWeek.Sunday,
                DayOfWeek.Thursday
            };
            wdc.GetModel().Scheduled.WeeklyPeriod.Period = 2;
            wdc.GetModel().Scheduled.StartDate = new DateTime(2019, 2, 5);

            var res = wdc.GetScheduledDays();


            Assert.True(ScheduleController.ContainsDay(res, new DateTime(2019, 2, 7)));
            Assert.True(ScheduleController.ContainsDay(res, new DateTime(2019, 2, 10)));
            Assert.True(ScheduleController.ContainsDay(res, new DateTime(2019, 2, 21)));
            Assert.True(ScheduleController.ContainsDay(res, new DateTime(2019, 2, 24)));
        }