use of javax.measure.quantity.Speed in project indriya by unitsofmeasurement.
the class UnitFormatTest method testFormatLocal.
@Test
public void testFormatLocal() {
final UnitFormat format = LocalUnitFormat.getInstance();
final Appendable a = new StringBuilder();
try {
format.format(METRE, a);
} catch (IOException e) {
fail(e.getMessage());
}
assertEquals(METRE, sut.getUnit());
assertEquals("m", a.toString());
final Appendable a2 = new StringBuilder();
@SuppressWarnings("unchecked") Unit<Speed> v = (Unit<Speed>) METRE.divide(SECOND);
try {
format.format(v, a2);
} catch (IOException e) {
fail(e.getMessage());
}
assertEquals("m/s", a2.toString());
}
use of javax.measure.quantity.Speed in project uom-se by unitsofmeasurement.
the class UnitFormatTest method testFormatLocal.
@Test
public void testFormatLocal() {
final UnitFormat format = LocalUnitFormat.getInstance();
final Appendable a = new StringBuilder();
try {
format.format(METRE, a);
} catch (IOException e) {
fail(e.getMessage());
}
assertEquals(METRE, sut.getUnit());
assertEquals("m", a.toString());
final Appendable a2 = new StringBuilder();
@SuppressWarnings("unchecked") Unit<Speed> v = (Unit<Speed>) METRE.divide(SECOND);
try {
format.format(v, a2);
} catch (IOException e) {
fail(e.getMessage());
}
assertEquals("m/s", a2.toString());
}
Aggregations