private static void InitializeSensors()
        {
            _temperatureSensor1 = new TemperatureSensor("Temp1");

            _temperatureSensor2 = new TemperatureSensor("Temp2");
            _pressureSensor     = new PressureSensor();
        }
Exemplo n.º 2
0
        private (string SensorId, double Temperature) GetTemperatureSensorData(TemperatureSensor temperatureSensor)
        {
            string SensorId    = temperatureSensor.Id;
            double Temperature = temperatureSensor.GetTemperature();

            Debug.Assert(!string.IsNullOrWhiteSpace(SensorId), "sensor-id should not be null or blank");
            Debug.Assert(Temperature >= 0, "temperature shouldbe >= 0");

            return(SensorId, Temperature);
        }