Class LengthTest

java.lang.Object
org.djunits.quantity.LengthTest

class LengthTest extends Object
LengthTest tests the Length quantity class.

Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.

Author:
Alexander Verbraeck (specifications); Test implementation by Copilot.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final void
    Use standard locale for all tests.
    (package private) void
    Test Length.add(Position): reference propagation, display unit propagation, and SI math.
    (package private) void
    Test constructors, constants, parsing (incl. error branches), SI conversions, instantiate, siUnit, and ofSi.
    (package private) void
    Test arithmetic operations (divide/multiply variants) and reciprocal.
    (package private) void
    Test Unit behavior: base/si unit, ofSi, deriveUnit (linear), and non-linear branch throwing UnitRuntimeException.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LengthTest

      LengthTest()
  • Method Details

    • setup

      @BeforeEach final void setup()
      Use standard locale for all tests.
    • testLengthBasicsAndParsing

      @Test void testLengthBasicsAndParsing()
      Test constructors, constants, parsing (incl. error branches), SI conversions, instantiate, siUnit, and ofSi.
    • testLengthOperations

      @Test void testLengthOperations()
      Test arithmetic operations (divide/multiply variants) and reciprocal.
    • testAddWithPosition

      @Test void testAddWithPosition()
      Test Length.add(Position): reference propagation, display unit propagation, and SI math.
    • testUnitBehavior

      @Test void testUnitBehavior()
      Test Unit behavior: base/si unit, ofSi, deriveUnit (linear), and non-linear branch throwing UnitRuntimeException.