public void EveryWeekday() { // Arrange var sunday = new DateTime(2018, 02, 18); var saturday = new DateTime(2018, 02, 17); var monday = new DateTime(2018, 02, 19); var calculator = new TimeCalculator(); var run = new DayUnit(calculator); // Act run.Weekday(); var calculated = calculator.Calculate(sunday); // Assert var expected = new DateTime(2018, 02, 19); Assert.AreEqual(expected, calculated); // Act calculated = calculator.Calculate(saturday); // Assert Assert.AreEqual(expected, calculated); // Act calculated = calculator.Calculate(monday); // Assert Assert.AreEqual(expected, calculated); }
private void CalculateNextRun(DateTime last) => NextRun = _calculator.Calculate(last);