Package org.djunits.quantity
Class LengthTest
java.lang.Object
org.djunits.quantity.LengthTest
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 -
Method Summary
Modifier and TypeMethodDescription(package private) final voidsetup()Use standard locale for all tests.(package private) voidTest Length.add(Position): reference propagation, display unit propagation, and SI math.(package private) voidTest constructors, constants, parsing (incl. error branches), SI conversions, instantiate, siUnit, and ofSi.(package private) voidTest arithmetic operations (divide/multiply variants) and reciprocal.(package private) voidTest Unit behavior: base/si unit, ofSi, deriveUnit (linear), and non-linear branch throwing UnitRuntimeException.
-
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.
-