Class AbstractOffsetUnitTest<OU extends 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 Unit<OU>> extends AbstractUnitTest<OU>

Copyright (c) 2013-2024 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 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 check
      expectedRatio - Double; expected ratio
      expectedOffset - Double; expected offset
      precision - Double; precision of verification
      expectedName - String; expected name in the resources
      expectedAbbreviation - String; expected abbreviation in the resources
    • getMultiplicationFactorTo

      public final double getMultiplicationFactorTo(OU fromUnit, OU toUnit)
      Parameters:
      fromUnit - U; the unit to convert from
      toUnit - U; the unit to convert to
      Returns:
      multiplication factor to convert a value from fromUnit to toUnit