Example #1
0
        public void At()
        {
            // Arrange
            var calculator = new TimeCalculator();
            var run        = new PeriodOnceSet(calculator);

            var now = DateTime.Now;

            // Act
            run.At(now.Hour, now.Minute);
            var calculated = calculator.Calculate(now);

            // Assert
            Assert.AreEqual(now.Hour, calculated.Value.Hour);
            Assert.AreEqual(now.Minute, calculated.Value.Minute);
        }
Example #2
0
        public void AtTimeSpan()
        {
            // Arrange
            var calculator = new TimeCalculator();
            var run        = new PeriodOnceSet(calculator);

            var now      = DateTime.Now;
            var timeSpan = new TimeSpan(12, 30, 0);

            // Act
            run.At(timeSpan);
            var calculated = calculator.Calculate(now);

            // Assert
            Assert.AreEqual(timeSpan.Hours, calculated.Value.Hour);
            Assert.AreEqual(timeSpan.Minutes, calculated.Value.Minute);
        }