Skip to content

Commit

Permalink
https://github.com/unitsofmeasurement/unit-api/issues/250
Browse files Browse the repository at this point in the history
  • Loading branch information
keilw committed May 9, 2023
1 parent 7bb4e10 commit 385e97a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/test/java/javax/measure/test/MetricPrefixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
import static javax.measure.test.unit.TimeUnit.*;
import static javax.measure.test.unit.VolumeUnit.*;

/**
* JUnit tests for the 24 prefixes used in the metric system (decimal multiples and submultiples of units).
*
* @author <a href="mailto:[email protected]">Werner Keil</a>
* @version 2.2, May 9, 2023
* @since 2.0
*/
public class MetricPrefixTest {
@Test
public void testAtto() {
Expand Down Expand Up @@ -83,6 +90,13 @@ public void testDeci() {

@Test
public void testDeca() {
assertEquals("da", DECA.getSymbol());
Quantity<Volume> v1 = TestQuantities.getQuantity(1.0, DECA(litre));
assertEquals("0.01", v1.getUnit().toString());
}

@Test
public void testDeka() {
assertEquals("da", DECA.getSymbol());
Quantity<Volume> v1 = TestQuantities.getQuantity(1.0, DEKA(litre));
assertEquals("0.01", v1.getUnit().toString());
Expand Down Expand Up @@ -153,7 +167,7 @@ public void testMicro() {
assertEquals("m", m1.getUnit().getSymbol());

Quantity<Length> m2 = m1.to(MICRO(m));
assertNull(m2); // TODO temporary workaround
assertNull(m2); // the unit model in the test implementation is only partial, hence null here
}

@Test
Expand All @@ -163,7 +177,7 @@ public void testNano() {
assertEquals("m", m1.getUnit().getSymbol());

Quantity<Length> m2 = m1.to(NANO(m));
assertNull(m2); // TODO temporary workaround
assertNull(m2); // the unit model in the test implementation is only partial, hence null here
}

@Test
Expand Down

0 comments on commit 385e97a

Please sign in to comment.