summaryrefslogtreecommitdiff
path: root/src/test/java/sevenUnitsGUI/PresenterTest.java
diff options
context:
space:
mode:
authorAdrien Hopkins <ahopk127@my.yorku.ca>2022-04-18 17:01:54 -0500
committerAdrien Hopkins <ahopk127@my.yorku.ca>2022-04-18 17:15:22 -0500
commitf0541a955b6e4b12d808cffec0874f50a004e8b9 (patch)
tree9b7960bd55c3d1d7c8d930802c6a2bcbafc8d49f /src/test/java/sevenUnitsGUI/PresenterTest.java
parent855cdf83b91bd3061662e563db6656408cc24a12 (diff)
Implemented rounding and duplicate-removal settings into the new GUI
Diffstat (limited to 'src/test/java/sevenUnitsGUI/PresenterTest.java')
-rw-r--r--src/test/java/sevenUnitsGUI/PresenterTest.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/java/sevenUnitsGUI/PresenterTest.java b/src/test/java/sevenUnitsGUI/PresenterTest.java
index 8446a90..f52d846 100644
--- a/src/test/java/sevenUnitsGUI/PresenterTest.java
+++ b/src/test/java/sevenUnitsGUI/PresenterTest.java
@@ -60,10 +60,9 @@ public final class PresenterTest {
* @since 2022-04-16
*/
private static final Stream<Function<UncertainDouble, String>> getRoundingRules() {
- final var SCIENTIFIC_ROUNDING = StandardDisplayRules.getScientificRule();
- final var INTEGER_ROUNDING = StandardDisplayRules.getFixedPlacesRule(0);
- final var SIG_FIG_ROUNDING = StandardDisplayRules
- .getFixedPrecisionRule(4);
+ final var SCIENTIFIC_ROUNDING = StandardDisplayRules.uncertaintyBased();
+ final var INTEGER_ROUNDING = StandardDisplayRules.fixedDecimals(0);
+ final var SIG_FIG_ROUNDING = StandardDisplayRules.fixedPrecision(4);
return Stream.of(SCIENTIFIC_ROUNDING, INTEGER_ROUNDING, SIG_FIG_ROUNDING);
}
@@ -264,20 +263,19 @@ public final class PresenterTest {
// set and save custom settings
presenter.setOneWayConversionEnabled(true);
presenter.setShowDuplicateUnits(true);
- presenter.setNumberDisplayRule(
- StandardDisplayRules.getFixedPrecisionRule(11));
+ presenter.setNumberDisplayRule(StandardDisplayRules.fixedPrecision(11));
presenter.saveSettings(TEST_SETTINGS);
// overwrite custom settings
presenter.setOneWayConversionEnabled(false);
presenter.setShowDuplicateUnits(false);
- presenter.setNumberDisplayRule(StandardDisplayRules.getScientificRule());
+ presenter.setNumberDisplayRule(StandardDisplayRules.uncertaintyBased());
// load settings & test that they're the same
presenter.loadSettings(TEST_SETTINGS);
assertTrue(presenter.oneWayConversionEnabled());
assertTrue(presenter.duplicateUnitsShown());
- assertEquals(StandardDisplayRules.getFixedPlacesRule(11),
+ assertEquals(StandardDisplayRules.fixedPrecision(11),
presenter.getNumberDisplayRule());
}