use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.
the class IeQualityConverterTest method shouldConvertIeQualitySubstitutedToByte.
@Test
public void shouldConvertIeQualitySubstitutedToByte() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_SUBSTITUTED);
final IeQuality source = new IeQuality(false, false, true, 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 DomainDistributionAutomationMapperTest method testBitmaskMeasurementElementMapping.
@Test
public void testBitmaskMeasurementElementMapping() {
// Arrange
final byte value = (byte) 40;
final BitmaskMeasurementElement expected = new BitmaskMeasurementElement(value);
final BitmaskMeasurementElementDto dtoMeasurementElement = new BitmaskMeasurementElementDto(value);
// Act
final BitmaskMeasurementElement actual = this.mapper.map(dtoMeasurementElement, BitmaskMeasurementElement.class);
// 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 testConvertIeSinglePointWithQualityInvalid.
@Test
public void testConvertIeSinglePointWithQualityInvalid() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_INVALID);
final IeSinglePointWithQuality source = new IeSinglePointWithQuality(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 IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityNotTopical.
@Test
public void testConvertIeSinglePointWithQualityNotTopical() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_NOT_TOPICAL);
final IeSinglePointWithQuality source = new IeSinglePointWithQuality(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 shouldConvertIeQualityBlockedToByte.
@Test
public void shouldConvertIeQualityBlockedToByte() {
// Arrange
final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_BLOCKED);
final IeQuality source = new IeQuality(false, true, false, false, false);
// Act
final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
// Assert
assertThat(actual).isEqualTo(expected);
}
Aggregations