Search in sources :

Example 1 with IeQuality

use of org.openmuc.j60870.ie.IeQuality 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);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 2 with IeQuality

use of org.openmuc.j60870.ie.IeQuality 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);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 3 with IeQuality

use of org.openmuc.j60870.ie.IeQuality 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);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 4 with IeQuality

use of org.openmuc.j60870.ie.IeQuality 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);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 5 with IeQuality

use of org.openmuc.j60870.ie.IeQuality 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);
}
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