public async Task MoveInRoomShouldNotTurnOnLightWhenAutomationIsDisabled()
        {
            var(motionEvents, scheduler, lampDictionary) = new LightAutomationServiceBuilder(_context).WithMotion
                                                           (
                OnNext(Time.Tics(500), new MotionEnvelope(Detectors.toiletDetector))
                                                           ).Build();

            _context.Send(DisableAutomationCommand.Create(Detectors.toiletDetector));
            scheduler.AdvanceToEnd(motionEvents);

            Assert.AreEqual(false, lampDictionary[Detectors.toiletDetector].IsTurnedOn);
            Assert.AreEqual(true, await _context.Query <bool>(AutomationStateQuery.Create(Detectors.toiletDetector)));
        }
Пример #2
0
 protected void SendCommand(Command command) => _context.Send(command);