diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/sevenUnitsGUI/RoundingTest.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/java/sevenUnitsGUI/RoundingTest.java b/src/test/java/sevenUnitsGUI/RoundingTest.java index ddf9cf3..ca1a272 100644 --- a/src/test/java/sevenUnitsGUI/RoundingTest.java +++ b/src/test/java/sevenUnitsGUI/RoundingTest.java @@ -242,6 +242,19 @@ class RoundingTest { } /** + * Tests that the rounding methods' equals() methods work. + * + * @since v0.4.0 + * @since 2022-07-17 + */ + @Test + void testHashCode() { + assertEquals(ZERO_DECIMALS.hashCode(), ZERO_DECIMALS.hashCode()); + assertEquals(ONE_SIG_FIG.hashCode(), ONE_SIG_FIG.hashCode()); + assertEquals(UNCERTAINTY_BASED.hashCode(), UNCERTAINTY_BASED.hashCode()); + } + + /** * Tests that the {@code toString()} methods of the three rounding rule * classes work correctly. * @@ -267,7 +280,7 @@ class RoundingTest { @MethodSource("uncertaintyRoundingExamples") void testUncertaintyRounding(UncertainDouble input, String output) { assertEquals(output, UNCERTAINTY_BASED.apply(input), - String.format( + () -> String.format( "Uncertainty Rounding rounded %s as %s (should be %s)", input, UNCERTAINTY_BASED.apply(input), output)); } |