public void NowAndEvery() { // Arrange var now = DateTime.Now; var calculator = new TimeCalculator(); var run = new RunSpecifier(calculator); // Act run.Now().AndEvery(10).Seconds(); var calculated = calculator.Calculate(now); // Assert Assert.AreEqual(now, calculated); // Act calculated = calculator.Calculate(now); // Assert Assert.AreEqual(now.AddSeconds(10), calculated); }
public void Now() { // Arrange var now = DateTime.Now; var calculator = new TimeCalculator(); var run = new RunSpecifier(calculator); // Act run.Now(); var calculated = calculator.Calculate(now); // Assert Assert.AreEqual(now, calculated); // Act calculated = calculator.Calculate(now); // Assert Assert.AreEqual(null, calculated); }