use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityAll.
@Test
public void testConvertIeSinglePointWithQualityAll() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_ALL);
final IeSinglePointWithQuality source = new IeSinglePointWithQuality(true, true, true, true, true);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityBlocked.
@Test
public void testConvertIeSinglePointWithQualityBlocked() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_BLOCKED);
final IeSinglePointWithQuality source = new IeSinglePointWithQuality(false, true, false, false, false);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeQualityConverterTest method shouldConvertIeQualityNotTopicalToByte.
@Test
public void shouldConvertIeQualityNotTopicalToByte() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_NOT_TOPICAL);
final IeQuality source = new IeQuality(false, false, false, true, false);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeQualityConverterTest method shouldConvertIeQualityInvalidToByte.
@Test
public void shouldConvertIeQualityInvalidToByte() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_INVALID);
final IeQuality source = new IeQuality(false, false, false, false, true);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeQualityConverterTest method shouldConvertIeQualityOverflowToByte.
@Test
public void shouldConvertIeQualityOverflowToByte() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_OVERFLOW);
final IeQuality source = new IeQuality(true, false, false, false, false);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
Aggregations