-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/unitsofmeasurement/unit-api/issues/250
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() { | ||
|
@@ -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()); | ||
|
@@ -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 | ||
|
@@ -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 | ||
|