Package org.unitConverter.unit
Class UnitDatabaseTest
- java.lang.Object
-
- org.unitConverter.unit.UnitDatabaseTest
-
class UnitDatabaseTest extends java.lang.Object
A test for theUnitDatabase
class. 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 UnitPrefix
A
private static UnitPrefix
AB
private static UnitPrefix
B
private static UnitPrefix
BC
private static UnitPrefix
C
private static LinearUnit
J
private static LinearUnit
K
private static Unit
NONLINEAR
private static Unit
U
private static Unit
V
private static Unit
W
-
Constructor Summary
Constructors Constructor Description UnitDatabaseTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testInfiniteSetExceptions()
Confirms that operations that shouldn't function for infinite databases throw anIllegalStateException
.void
testPrefixes()
Test that prefixes correctly apply to units.void
testPrefixlessUnitMap()
Tests the functionnalites of the prefixless unit map.void
testPrefixlessUnits()
Tests that the database correctly stores and retrieves units, ignoring prefixes.void
testUnitExpressions()
Test that unit expressions return the correct value.void
testUnitIterator()
Tests both the unit name iterator and the name-unit entry iteratorvoid
testUnitPrefixCombinations()
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
-
-