Beispiel #1
0
 public void GivenInvalidPartialId_WhenNewDevice_ThenDeviceIsNotAvailable()
 {
     using (var device = new ExtronDSC301HD("invalid"))
     {
         Assert.IsFalse(device.GetAvailable());
     }
 }
Beispiel #2
0
        public ExtronDSC301HDModel(IConfiguration configuration, IWebHostEnvironment environment)
        {
            _configuration = configuration;
            _environment   = environment;

            _connectionString = _configuration.GetValue <string>("ControlAVPIoTHubConnectionString");
            _deviceId         = _configuration.GetValue <string>("ControlAVPIoTHubDeviceId");

            _serviceClient = ServiceClient.CreateFromConnectionString(_connectionString);
            _device        = new ExtronDSC301HD(_serviceClient, _deviceId);
        }
        public IndexModel(IConfiguration configuration, IWebHostEnvironment environment)
        {
            Contract.Requires(configuration != null);
            Contract.Requires(environment != null);

            _configuration = configuration;
            _environment   = environment;

            _connectionString = _configuration.GetValue <string>("ControlAVPIoTHubConnectionString");
            _deviceId         = _configuration.GetValue <string>("ControlAVPIoTHubDeviceId");

            _serviceClient  = ServiceClient.CreateFromConnectionString(_connectionString);
            _cp             = new CommandDispatcher(_serviceClient, _deviceId);
            _extronDSC301HD = new ExtronDSC301HD(_serviceClient, _deviceId);
            _apcAP8959EU3   = new ApcAP8959EU3(_serviceClient, _deviceId);
            _sonySimpleIP   = new SonySimpleIP(_serviceClient, _deviceId);
            _ossc           = new OSSC(_serviceClient, _deviceId);

            _outlets            = _apcAP8959EU3.GetOutlets();
            _outletConfirmation = _configuration.GetSection("OutletConfirmation").Get <string[]>();

            _commandDirectory = Path.Combine(_environment.WebRootPath, "commands");
        }
 public ExtronDSC301HDCloudInterface(ExtronDSC301HD device)
 {
     _device = device;
 }
 public void Setup()
 {
     _serviceClient = ServiceClient.CreateFromConnectionString(_settings.ConnectionString);
     _device        = new ExtronDSC301HD(_serviceClient, _settings.DeviceId);
 }
Beispiel #6
0
 public void GivenNullPartialId_WhenNewDevice_ThenExceptionThrown()
 {
     using (var device = new ExtronDSC301HD(null))
     {
     }
 }
Beispiel #7
0
 public void GivenEmptyPartialId_WhenNewDevice_ThenExceptionThrown()
 {
     using (var device = new ExtronDSC301HD(string.Empty))
     {
     }
 }