Package org.djunits.unit
Class AbstractOffsetUnitTest<OU extends org.djunits.unit.Unit<OU>>
java.lang.Object
org.djunits.unit.AbstractUnitTest<OU>
org.djunits.unit.AbstractOffsetUnitTest<OU>
- Type Parameters:
OU
- Make the test specific for this sub class of OffsetUnit
- Direct Known Subclasses:
AbsoluteTemperatureUnitTest
,PositionUnitTest
,TimeUnitTest
public class AbstractOffsetUnitTest<OU extends org.djunits.unit.Unit<OU>> extends AbstractUnitTest<OU>
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Peter Knoppers
-
Constructor Summary
Constructors Constructor Description AbstractOffsetUnitTest()
-
Method Summary
Modifier and Type Method Description protected void
checkUnitRatioOffsetNameAndAbbreviation(OU ou, double expectedRatio, double expectedOffset, double precision, String expectedName, String expectedAbbreviation)
Verify one length conversion factor to standard unit and the localization of the name and abbreviation.double
getMultiplicationFactorTo(OU fromUnit, OU toUnit)
-
Constructor Details
-
AbstractOffsetUnitTest
public AbstractOffsetUnitTest()
-
-
Method Details
-
checkUnitRatioOffsetNameAndAbbreviation
protected final void checkUnitRatioOffsetNameAndAbbreviation(OU ou, double expectedRatio, double expectedOffset, double precision, String expectedName, String expectedAbbreviation)Verify one length conversion factor to standard unit and the localization of the name and abbreviation.- Parameters:
ou
- Unit to checkexpectedRatio
- Double; expected ratioexpectedOffset
- Double; expected offsetprecision
- Double; precision of verificationexpectedName
- String; expected name in the resourcesexpectedAbbreviation
- String; expected abbreviation in the resources
-
getMultiplicationFactorTo
- Parameters:
fromUnit
- U; the unit to convert fromtoUnit
- U; the unit to convert to- Returns:
- multiplication factor to convert a value from fromUnit to toUnit
-