public DateTime GetNext() { var includeToday = true; if (DateTime.Now.TimeOfDay > Time.TimeOfDay) { includeToday = false; } var repeat = new RepeatWeek(Repeat); var nextDayOfWeek = repeat.GetNextDay(includeToday); return(MergeDayOfWeekAndTime(nextDayOfWeek, Time)); }
public void GetNextDayOfWeek() { var repeat = new RepeatWeek(); repeat.setDay(DayOfWeek.Monday); repeat.setDay(DayOfWeek.Tuesday); var expected = DayOfWeek.Monday; if (DateTime.Now.DayOfWeek == DayOfWeek.Monday) { expected = DayOfWeek.Tuesday; } var actual = repeat.GetNextDay(); Assert.AreEqual(expected, actual); }