コード例 #1
0
        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 Task <T> Query <T>(Query query) => _context.Query <T>(query);