コード例 #1
0
ファイル: CoolerDevice.cs プロジェクト: erviveksoni/Aucovei
        /// <summary>
        /// Builds up the set of commands that are supported by this device
        /// </summary>
        protected override void InitCommandProcessors()
        {
            var pingDeviceProcessor   = new PingDeviceProcessor(this);
            var startCommandProcessor = new StartCommandProcessor(this);
            var stopCommandProcessor  = new StopCommandProcessor(this);
            var diagnosticTelemetryCommandProcessor = new DiagnosticTelemetryCommandProcessor(this);
            var changeSetPointTempCommandProcessor  = new ChangeSetPointTempCommandProcessor(this);
            var changeDeviceStateCommmandProcessor  = new ChangeDeviceStateCommandProcessor(this);
            var sendWaypointsCommandProcessor       = new SendWaypointsCommandProcessor(this);
            var emergencyStopCommandProcessor       = new EmergencyStopProcessor(this);
            var setLightsCommandProcessor           = new SetLightsProcessor(this);
            var setCameraCommandProcessor           = new SetCameraProcessor(this);
            var sendBuzzerCommandProcessor          = new SendBuzzerProcessor(this);
            var demoRunCommandProcessor             = new DemoRunProcessor(this);

            pingDeviceProcessor.NextCommandProcessor   = startCommandProcessor;
            startCommandProcessor.NextCommandProcessor = stopCommandProcessor;
            stopCommandProcessor.NextCommandProcessor  = diagnosticTelemetryCommandProcessor;
            diagnosticTelemetryCommandProcessor.NextCommandProcessor = changeSetPointTempCommandProcessor;
            changeSetPointTempCommandProcessor.NextCommandProcessor  = sendWaypointsCommandProcessor;
            sendWaypointsCommandProcessor.NextCommandProcessor       = emergencyStopCommandProcessor;
            emergencyStopCommandProcessor.NextCommandProcessor       = setLightsCommandProcessor;
            setLightsCommandProcessor.NextCommandProcessor           = sendBuzzerCommandProcessor;
            sendBuzzerCommandProcessor.NextCommandProcessor          = demoRunCommandProcessor;
            demoRunCommandProcessor.NextCommandProcessor             = changeDeviceStateCommmandProcessor;
            changeDeviceStateCommmandProcessor.NextCommandProcessor  = setCameraCommandProcessor;
            RootCommandProcessor = pingDeviceProcessor;
        }
コード例 #2
0
        /// <summary>
        /// Builds up the set of commands that are supported by this device
        /// </summary>
        protected override void InitCommandProcessors()
        {
            var pingDeviceProcessor   = new PingDeviceProcessor(this);
            var startCommandProcessor = new StartCommandProcessor(this);
            var stopCommandProcessor  = new StopCommandProcessor(this);

            pingDeviceProcessor.NextCommandProcessor   = startCommandProcessor;
            startCommandProcessor.NextCommandProcessor = stopCommandProcessor;

            RootCommandProcessor = pingDeviceProcessor;
        }
 public StartCommandProcessorTests()
 {
     _loggerMock                = new Mock <ILogger>();
     _transportFactory          = new Mock <ITransportFactory>();
     _telemetryFactoryMock      = new Mock <ITelemetryFactory>();
     _configurationProviderMock = new Mock <IConfigurationProvider>();
     _transport    = new Mock <ITransport>();
     _coolerDevice = new Mock <CoolerDevice>(_loggerMock.Object, _transportFactory.Object, _telemetryFactoryMock.Object,
                                             _configurationProviderMock.Object);
     _startCommandProcessor = new StartCommandProcessor(_coolerDevice.Object);
 }
コード例 #4
0
        /// <summary>
        /// Builds up the set of commands that are supported by this device
        /// </summary>
        protected override void InitCommandProcessors()
        {
            var pingDeviceProcessor = new PingDeviceProcessor(this);
            var startCommandProcessor = new StartCommandProcessor(this);
            var stopCommandProcessor = new StopCommandProcessor(this);

            pingDeviceProcessor.NextCommandProcessor = startCommandProcessor;
            startCommandProcessor.NextCommandProcessor = stopCommandProcessor;

            RootCommandProcessor = pingDeviceProcessor;
        }
コード例 #5
0
        public async Task ProcessAsync()
        {
            var telegramMock    = new Mock <ITelegramService>();
            var sendMessageMock = new Mock <IBotSendMessageService>();

            var service = new StartCommandProcessor(sendMessageMock.Object, telegramMock.Object, null);

            await service.ProcessAsync(new StartCommand("key")
            {
                UserChatId = 100
            });

            telegramMock.Verify(x => x.UpdateChatId("key", 100));
            sendMessageMock.Verify(x => x.SendTextAsync(100, "Registered"));
        }
コード例 #6
0
ファイル: CoolerDevice.cs プロジェクト: klavshp/PnIoTPoc
        /// <summary>
        /// Builds up the set of commands that are supported by this device
        /// </summary>
        protected override void InitCommandProcessors()
        {
            var pingDeviceProcessor   = new PingDeviceProcessor(this);
            var startCommandProcessor = new StartCommandProcessor(this);
            var stopCommandProcessor  = new StopCommandProcessor(this);
            var diagnosticTelemetryCommandProcessor = new DiagnosticTelemetryCommandProcessor(this);
            var changeSetPointTempCommandProcessor  = new ChangeSetPointTempCommandProcessor(this);
            var changeDeviceStateCommmandProcessor  = new ChangeDeviceStateCommandProcessor(this);

            pingDeviceProcessor.NextCommandProcessor   = startCommandProcessor;
            startCommandProcessor.NextCommandProcessor = stopCommandProcessor;
            stopCommandProcessor.NextCommandProcessor  = diagnosticTelemetryCommandProcessor;
            diagnosticTelemetryCommandProcessor.NextCommandProcessor = changeSetPointTempCommandProcessor;
            changeSetPointTempCommandProcessor.NextCommandProcessor  = changeDeviceStateCommmandProcessor;

            RootCommandProcessor = pingDeviceProcessor;
        }
コード例 #7
0
 public void SetUp()
 {
     _responder = new Mock <ITelegramMessageSender>();
     _processor = new StartCommandProcessor(_responder.Object);
 }