Class MassTest

java.lang.Object
org.djunits.quantity.MassTest

class MassTest extends Object
MassTest tests the Mass 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
    Standard locale for the tests.
    (package private) void
    Test constructors, constants, parsing, SI conversions, instantiate, siUnit, and ofSi.
    (package private) void
    Test arithmetic operations.
    (package private) void
    Test error branches of valueOf and of (null, empty, unknown unit, malformed number).
    (package private) void
    Test the Unit behavior: base/si unit, Unit.ofSi delegation, deriving linear units, non-linear derivation exception branch, and registry sanity.
    (package private) void
    Test prefixed SI units and selected special/imperial units.

    Methods inherited from class java.lang.Object

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

    • MassTest

      MassTest()
  • Method Details

    • setup

      @BeforeEach final void setup()
      Standard locale for the tests.
    • testMassBasics

      @Test void testMassBasics()
      Test constructors, constants, parsing, SI conversions, instantiate, siUnit, and ofSi.
    • testUnitsAndPrefixes

      @Test void testUnitsAndPrefixes()
      Test prefixed SI units and selected special/imperial units.
    • testParsingErrorBranches

      @Test void testParsingErrorBranches()
      Test error branches of valueOf and of (null, empty, unknown unit, malformed number).
    • testMassOperations

      @Test void testMassOperations()
      Test arithmetic operations.
    • testUnitBehavior

      @Test void testUnitBehavior()
      Test the Unit behavior: base/si unit, Unit.ofSi delegation, deriving linear units, non-linear derivation exception branch, and registry sanity.