Package org.djunits.vecmat.storage
Class DoubleSparseValueTest
java.lang.Object
org.djunits.vecmat.storage.DoubleSparseValueTest
Unit tests for
DoubleSparseValue.
Ensures 100% coverage of all constructors, accessors, null checks, negative index errors, SI-conversion, and toString() formatting. 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 TypeMethodDescriptionvoidTest constructor(row,col,Quantity) including SI-conversion and null-check.voidTest constructor(row,col,si) and valid SI assignment.voidTest constructor(row,col,valueInUnit,unit) including toBaseValue conversion.voidTest toString formatting for basic sanity.
-
Constructor Details
-
DoubleSparseValueTest
public DoubleSparseValueTest()
-
-
Method Details
-
testCtorQuantity
@Test @DisplayName("ctor(row,col,Q): SI + null check + negative index") public void testCtorQuantity()Test constructor(row,col,Quantity) including SI-conversion and null-check. -
testCtorValueUnit
@Test @DisplayName("ctor(row,col,valueInUnit,unit): conversion to SI") public void testCtorValueUnit()Test constructor(row,col,valueInUnit,unit) including toBaseValue conversion. -
testCtorSI
@Test @DisplayName("ctor(row,col,si): direct SI storage + negative index errors") public void testCtorSI()Test constructor(row,col,si) and valid SI assignment. -
testToString
@Test @DisplayName("toString(): contains row/column/value") public void testToString()Test toString formatting for basic sanity.
-