use of de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.DoubleValue in project FAAAST-Service by FraunhoferIOSB.
the class ElementValueMapperTest method testRangeToValueMapping.
@Test
public void testRangeToValueMapping() {
RangeValue expected = RangeValue.builder().min(new DoubleValue(2.3)).max(new DoubleValue(5.1)).build();
SubmodelElement input = new DefaultRange.Builder().valueType(expected.getMin().getDataType().getName()).min(expected.getMin().asString()).max(expected.getMax().asString()).build();
ElementValue actual = ElementValueMapper.toValue(input);
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.DoubleValue in project FAAAST-Service by FraunhoferIOSB.
the class ElementValueMapperTest method testRangeSetValueMapping.
@Test
public void testRangeSetValueMapping() {
SubmodelElement actual = new DefaultRange.Builder().build();
RangeValue value = RangeValue.builder().min(new DoubleValue(2.3)).max(new DoubleValue(5.1)).build();
SubmodelElement expected = new DefaultRange.Builder().valueType(value.getMin().getDataType().getName()).min(value.getMin().asString()).max(value.getMax().asString()).build();
ElementValueMapper.setValue(actual, value);
Assert.assertEquals(expected, actual);
}
Aggregations