Search in sources :

Example 6 with IeQuality

use of org.openmuc.j60870.ie.IeQuality in project open-smart-grid-platform by OSGP.

the class IeQualityConverterTest method shouldConvertIeQualityNoneToByte.

@Test
public void shouldConvertIeQualityNoneToByte() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_NONE);
    final IeQuality source = new IeQuality(false, false, false, false, false);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 7 with IeQuality

use of org.openmuc.j60870.ie.IeQuality in project open-smart-grid-platform by OSGP.

the class IeQualityConverterTest method shouldConvertIeQualityAllToByte.

@Test
public void shouldConvertIeQualityAllToByte() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_ALL);
    final IeQuality source = new IeQuality(true, true, true, true, true);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)7 IeQuality (org.openmuc.j60870.ie.IeQuality)7 BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)7