summaryrefslogtreecommitdiff
path: root/src/test/java/sevenUnitsGUI
diff options
context:
space:
mode:
authorAdrien Hopkins <ahopk127@my.yorku.ca>2022-07-17 14:18:00 -0500
committerAdrien Hopkins <ahopk127@my.yorku.ca>2022-07-17 14:18:00 -0500
commit6274c1cda8248f93075d99bd5ea46922fbec7207 (patch)
tree42016caadf29cd6b18f1233fa604f45d06cd1135 /src/test/java/sevenUnitsGUI
parentd75177860e9b811e84cd79efc0c1d29445aeaba2 (diff)
Added another rounding rule test
Diffstat (limited to 'src/test/java/sevenUnitsGUI')
-rw-r--r--src/test/java/sevenUnitsGUI/RoundingTest.java15
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));
}