Package org.unitConverter.unit
Class UnitDatabaseTest
- java.lang.Object
-
- org.unitConverter.unit.UnitDatabaseTest
-
class UnitDatabaseTest extends java.lang.ObjectA test for theUnitDatabaseclass. This is NOT part of this program's public API.- Since:
- 2019-04-14, v0.2.0
- Author:
- Adrien Hopkins
-
-
Field Summary
Fields Modifier and Type Field Description private static UnitPrefixAprivate static UnitPrefixABprivate static UnitPrefixBprivate static UnitPrefixBCprivate static UnitPrefixCprivate static LinearUnitJprivate static LinearUnitKprivate static UnitNONLINEARprivate static UnitUprivate static UnitVprivate static UnitW
-
Constructor Summary
Constructors Constructor Description UnitDatabaseTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestInfiniteSetExceptions()Confirms that operations that shouldn't function for infinite databases throw anIllegalStateException.voidtestPrefixes()Test that prefixes correctly apply to units.voidtestPrefixlessUnitMap()Tests the functionnalites of the prefixless unit map.voidtestPrefixlessUnits()Tests that the database correctly stores and retrieves units, ignoring prefixes.voidtestUnitExpressions()Test that unit expressions return the correct value.voidtestUnitIterator()Tests both the unit name iterator and the name-unit entry iteratorvoidtestUnitPrefixCombinations()Determine, given a unit name that could mean multiple things, which meaning is chosen.
-
-
-
Field Detail
-
U
private static final Unit U
-
V
private static final Unit V
-
W
private static final Unit W
-
J
private static final LinearUnit J
-
K
private static final LinearUnit K
-
NONLINEAR
private static final Unit NONLINEAR
-
A
private static final UnitPrefix A
-
B
private static final UnitPrefix B
-
C
private static final UnitPrefix C
-
AB
private static final UnitPrefix AB
-
BC
private static final UnitPrefix BC
-
-
Method Detail
-
testInfiniteSetExceptions
@Test public void testInfiniteSetExceptions()
Confirms that operations that shouldn't function for infinite databases throw anIllegalStateException.- Since:
- 2019-05-03
-
testPrefixes
@Test public void testPrefixes()
Test that prefixes correctly apply to units.- Since:
- 2019-04-14, v0.2.0
-
testPrefixlessUnitMap
@Test public void testPrefixlessUnitMap()
Tests the functionnalites of the prefixless unit map.The map should be an auto-updating view of the units in the database.
- Since:
- 2019-04-14, v0.2.0
-
testPrefixlessUnits
@Test public void testPrefixlessUnits()
Tests that the database correctly stores and retrieves units, ignoring prefixes.- Since:
- 2019-04-14, v0.2.0
-
testUnitExpressions
@Test public void testUnitExpressions()
Test that unit expressions return the correct value.- Since:
- 2019-04-14, v0.2.0
-
testUnitIterator
@Test public void testUnitIterator()
Tests both the unit name iterator and the name-unit entry iterator- Since:
- 2019-04-14, v0.2.0
-
testUnitPrefixCombinations
@Test public void testUnitPrefixCombinations()
Determine, given a unit name that could mean multiple things, which meaning is chosen.For example, "ABCU" could mean "A-B-C-U", "AB-C-U", or "A-BC-U". In this case, "AB-C-U" is the correct choice.
- Since:
- 2019-04-14, v0.2.0
-
-