Пример #1
0
        public void Does_Not_Notify_If_PowerState_Is_Not_Changed()
        {
            _timeSlots.Add(new PowerTimeSlot()
            {
                DayOfWeek = DayOfWeek.Monday,
                StarTime  = new TimeSpan(14, 0, 0),
                EndTime   = new TimeSpan(15, 0, 0)
            });

            _timeProvider.Time = new DateTime(2018, 3, 19, 13, 0, 0);

            //Check the first time, if the given date matches the TimeSlot.
            _timeSlotManager.Start();

            //Check the second time, if the given date matches the TimeSlot.
            //The observer should not be notified, because the state did not changed
            _timer.Start();

            _timeSlotObserver.Calls.Should().Be(1, "because PowerState is still off.");
        }