示例#1
0
        private eDaysOfService __GetDayOfService(Schedule schedule, LeibitTime time)
        {
            foreach (eDaysOfService day in Enum.GetValues(typeof(eDaysOfService)))
            {
                if (schedule.Days.Contains(day) || !schedule.Days.Any())
                {
                    var ScheduleTime = new LeibitTime(day, schedule.Time.Hour, schedule.Time.Minute);

                    if (ScheduleTime > time.AddHours(-12) && ScheduleTime <= time.AddHours(12))
                    {
                        return(day);
                    }
                }
            }

            return(eDaysOfService.None);
        }
示例#2
0
        public void LeibitTimeTest_AddHours4()
        {
            LeibitTime time = new LeibitTime(eDaysOfService.Tuesday, 13, 7);

            time = time.AddHours(-75);

            Assert.AreEqual(eDaysOfService.Saturday, time.Day);
            Assert.AreEqual(10, time.Hour);
            Assert.AreEqual(7, time.Minute);
        }
示例#3
0
        public void LeibitTimeTest_AddHours2()
        {
            LeibitTime time = new LeibitTime(eDaysOfService.Tuesday, 13, 7);

            time = time.AddHours(50);

            Assert.AreEqual(eDaysOfService.Thursday, time.Day);
            Assert.AreEqual(15, time.Hour);
            Assert.AreEqual(7, time.Minute);
        }