diff --git a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java index 4eb8291bdc..8d893c3af8 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java @@ -223,13 +223,14 @@ public class ConstraintsCheckerTest { // No limit by default when(SP.getDouble(R.string.key_openapsma_max_iob, 1.5d)).thenReturn(1.5d); when(SP.getString(R.string.key_age, "")).thenReturn("teenage"); - OpenAPSMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, true); OpenAPSAMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, true); + OpenAPSMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, false); + OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, false); // Apply all limits Constraint d = constraintChecker.getMaxIOBAllowed(); Assert.assertEquals(1.5d, d.value()); - Assert.assertEquals(3, d.getReasonList().size()); + Assert.assertEquals(d.getReasonList().toString(),2, d.getReasonList().size()); Assert.assertEquals("Safety: Limiting IOB to 1.5 U because of max value in preferences", d.getMostLimitedReasons()); } @@ -240,11 +241,13 @@ public class ConstraintsCheckerTest { when(SP.getDouble(R.string.key_openapssmb_max_iob, 3d)).thenReturn(3d); when(SP.getString(R.string.key_age, "")).thenReturn("teenage"); OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, true); + OpenAPSAMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, false); + OpenAPSMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, false); // Apply all limits Constraint d = constraintChecker.getMaxIOBAllowed(); Assert.assertEquals(3d, d.value()); - Assert.assertEquals(4, d.getReasonList().size()); + Assert.assertEquals(d.getReasonList().toString(), 2, d.getReasonList().size()); Assert.assertEquals("Safety: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons()); }