(Hopefully) fix iob(AMA|SMB)shouldBeLimited tests.
By making sure there is exactly one APS plugin enabled.
This commit is contained in:
parent
8f647460b8
commit
afe9a845d3
|
@ -233,13 +233,14 @@ public class ConstraintsCheckerTest {
|
||||||
// No limit by default
|
// No limit by default
|
||||||
when(SP.getDouble(R.string.key_openapsma_max_iob, 1.5d)).thenReturn(1.5d);
|
when(SP.getDouble(R.string.key_openapsma_max_iob, 1.5d)).thenReturn(1.5d);
|
||||||
when(SP.getString(R.string.key_age, "")).thenReturn("teenage");
|
when(SP.getString(R.string.key_age, "")).thenReturn("teenage");
|
||||||
OpenAPSMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, true);
|
|
||||||
OpenAPSAMAPlugin.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
|
// Apply all limits
|
||||||
Constraint<Double> d = constraintChecker.getMaxIOBAllowed();
|
Constraint<Double> d = constraintChecker.getMaxIOBAllowed();
|
||||||
Assert.assertEquals(1.5d, d.value());
|
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());
|
Assert.assertEquals("Safety: Limiting IOB to 1.5 U because of max value in preferences", d.getMostLimitedReasons());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -250,11 +251,13 @@ public class ConstraintsCheckerTest {
|
||||||
when(SP.getDouble(R.string.key_openapssmb_max_iob, 3d)).thenReturn(3d);
|
when(SP.getDouble(R.string.key_openapssmb_max_iob, 3d)).thenReturn(3d);
|
||||||
when(SP.getString(R.string.key_age, "")).thenReturn("teenage");
|
when(SP.getString(R.string.key_age, "")).thenReturn("teenage");
|
||||||
OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, true);
|
OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, true);
|
||||||
|
OpenAPSAMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, false);
|
||||||
|
OpenAPSMAPlugin.getPlugin().setPluginEnabled(PluginType.APS, false);
|
||||||
|
|
||||||
// Apply all limits
|
// Apply all limits
|
||||||
Constraint<Double> d = constraintChecker.getMaxIOBAllowed();
|
Constraint<Double> d = constraintChecker.getMaxIOBAllowed();
|
||||||
Assert.assertEquals(3d, d.value());
|
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());
|
Assert.assertEquals("Safety: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue