public void AddBarSensorValueTest(SensorType type) { var sensorValue = _sensorValuesFactory.BuildSensorValue(type); (sensorValue as BarSensorValueBase).EndTime = System.DateTime.MinValue; _monitoringCore.AddSensorValue(sensorValue); var lastBarValue = _barStorage.GetLastValue(_testProductName, sensorValue.Path); Assert.Equal(_testProductName, lastBarValue.ProductName); Assert.Equal(SensorValuesTester.GetSensorValueType(sensorValue), lastBarValue.ValueType); Assert.Equal(sensorValue, lastBarValue.Value); }
private static void FullTestUpdatedSensorInfo(SensorInfo expected, SensorInfo actual, SensorValueBase sensorValue) { Assert.NotNull(actual); Assert.Equal(expected.Description, actual.Description); Assert.Equal(expected.Path, actual.Path); Assert.Equal(expected.ProductName, actual.ProductName); Assert.Equal(expected.ExpectedUpdateInterval, actual.ExpectedUpdateInterval); Assert.Equal(expected.Unit, actual.Unit); Assert.Equal(sensorValue.Path, actual.SensorName); Assert.Equal(SensorValuesTester.GetSensorValueType(sensorValue), actual.SensorType); Assert.NotEqual(expected.SensorName, actual.SensorName); Assert.NotEqual(expected.SensorType, actual.SensorType); Assert.Empty(actual.ValidationParameters); }
public void AddUnitedBarSensorValueTest(SensorType type) { var unitedValue = _sensorValuesFactory.BuildUnitedSensorValue(type, isMinEndTime: true); _monitoringCore.AddSensorsValues(new List <UnitedSensorValue>() { unitedValue }); var lastBarValue = _barStorage.GetLastValue(_testProductName, unitedValue.Path); Assert.Equal(_testProductName, lastBarValue.ProductName); Assert.Equal(SensorValuesTester.GetSensorValueType(unitedValue), lastBarValue.ValueType); SensorValuesTester.TestBarSensorFromUnitedSensor(unitedValue, lastBarValue.Value); }