use of javax.measure.quantity.Frequency in project indriya by unitsofmeasurement.
the class TimeQuantitiesTest method inverseTest.
@Test
public void inverseTest() {
TimeUnitQuantity tenSeconds = TimeUnitQuantity.of(10, TimeUnit.SECONDS);
Quantity<Frequency> perTenSeconds = tenSeconds.inverse();
assertEquals(Double.valueOf(0.1d), perTenSeconds.getValue());
assertEquals(HERTZ.getConverterTo(perTenSeconds.getUnit()), perTenSeconds.getUnit().getConverterTo(HERTZ));
}
use of javax.measure.quantity.Frequency in project indriya by unitsofmeasurement.
the class TimeQuantitiesTest method inverseTemporalTest.
@Test
public void inverseTemporalTest() {
TemporalQuantity tenSeconds = TemporalQuantity.of(10, SECONDS);
Quantity<Frequency> perTenSeconds = tenSeconds.inverse();
assertEquals(0.1d, perTenSeconds.getValue());
assertEquals(HERTZ.getConverterTo(perTenSeconds.getUnit()), perTenSeconds.getUnit().getConverterTo(HERTZ));
}
Aggregations