Search in sources :

Example 6 with TimeUnitQuantity

use of tech.units.indriya.quantity.time.TimeUnitQuantity in project indriya by unitsofmeasurement.

the class TimeQuantitiesConcurrentTest method toQuanityTest.

@Test
public void toQuanityTest() {
    TimeUnitQuantity day = TimeUnitQuantity.of(DAYS, 1);
    TimeUnitQuantity hour = TimeUnitQuantity.of(HOURS, 1);
    TimeUnitQuantity minute = TimeUnitQuantity.of(MINUTES, 1);
    TimeUnitQuantity second = TimeUnitQuantity.of(SECONDS, 1);
    TimeUnitQuantity microSecond = TimeUnitQuantity.of(MICROSECONDS, 1);
    TimeUnitQuantity milliSecond = TimeUnitQuantity.of(MILLISECONDS, 1);
    TimeUnitQuantity nanoSecond = TimeUnitQuantity.of(NANOSECONDS, 1);
    verifyQuantity(day.toQuantity(), DAY, 1);
    verifyQuantity(hour.toQuantity(), HOUR, 1);
    verifyQuantity(minute.toQuantity(), MINUTE, 1);
    verifyQuantity(second.toQuantity(), SECOND, 1);
    verifyQuantity(microSecond.toQuantity(), TimeQuantities.MICROSECOND, 1);
    verifyQuantity(milliSecond.toQuantity(), TimeQuantities.MILLISECOND, 1);
    verifyQuantity(nanoSecond.toQuantity(), TimeQuantities.NANOSECOND, 1);
}
Also used : TimeUnitQuantity(tech.units.indriya.quantity.time.TimeUnitQuantity) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)6 TimeUnitQuantity (tech.units.indriya.quantity.time.TimeUnitQuantity)6 Frequency (javax.measure.quantity.Frequency)1 Time (javax.measure.quantity.Time)1