fix test
This commit is contained in:
parent
a8631866da
commit
f9ec47010e
1 changed files with 6 additions and 7 deletions
|
@ -55,7 +55,6 @@ class BolusWizardTest : TestBase() {
|
||||||
it.rxBus = RxBusWrapper()
|
it.rxBus = RxBusWrapper()
|
||||||
it.profileFunction = profileFunction
|
it.profileFunction = profileFunction
|
||||||
it.constraintChecker = constraintChecker
|
it.constraintChecker = constraintChecker
|
||||||
it.context = context
|
|
||||||
it.activePlugin = activePlugin
|
it.activePlugin = activePlugin
|
||||||
it.commandQueue = commandQueue
|
it.commandQueue = commandQueue
|
||||||
it.loopPlugin = loopPlugin
|
it.loopPlugin = loopPlugin
|
||||||
|
@ -95,9 +94,9 @@ class BolusWizardTest : TestBase() {
|
||||||
/** Should calculate the same bolus when different blood glucose but both in target range */
|
/** Should calculate the same bolus when different blood glucose but both in target range */
|
||||||
fun shouldCalculateTheSameBolusWhenBGsInRange() {
|
fun shouldCalculateTheSameBolusWhenBGsInRange() {
|
||||||
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
||||||
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 4.2, 0.0, 100.0, true, true, true, true, false, false, false)
|
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 4.2, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForBg42 = bw.calculatedTotalInsulin
|
val bolusForBg42 = bw.calculatedTotalInsulin
|
||||||
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false)
|
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForBg54 = bw.calculatedTotalInsulin
|
val bolusForBg54 = bw.calculatedTotalInsulin
|
||||||
Assert.assertEquals(bolusForBg42, bolusForBg54, 0.01)
|
Assert.assertEquals(bolusForBg42, bolusForBg54, 0.01)
|
||||||
}
|
}
|
||||||
|
@ -105,9 +104,9 @@ class BolusWizardTest : TestBase() {
|
||||||
@Test
|
@Test
|
||||||
fun shouldCalculateHigherBolusWhenHighBG() {
|
fun shouldCalculateHigherBolusWhenHighBG() {
|
||||||
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
||||||
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 9.8, 0.0, 100.0, true, true, true, true, false, false, false)
|
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 9.8, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForHighBg = bw.calculatedTotalInsulin
|
val bolusForHighBg = bw.calculatedTotalInsulin
|
||||||
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false)
|
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForBgInRange = bw.calculatedTotalInsulin
|
val bolusForBgInRange = bw.calculatedTotalInsulin
|
||||||
Assert.assertTrue(bolusForHighBg > bolusForBgInRange)
|
Assert.assertTrue(bolusForHighBg > bolusForBgInRange)
|
||||||
}
|
}
|
||||||
|
@ -115,9 +114,9 @@ class BolusWizardTest : TestBase() {
|
||||||
@Test
|
@Test
|
||||||
fun shouldCalculateLowerBolusWhenLowBG() {
|
fun shouldCalculateLowerBolusWhenLowBG() {
|
||||||
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
val profile = setupProfile(4.0, 8.0, 20.0, 12.0)
|
||||||
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 3.6, 0.0, 100.0, true, true, true, true, false, false, false)
|
var bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 3.6, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForLowBg = bw.calculatedTotalInsulin
|
val bolusForLowBg = bw.calculatedTotalInsulin
|
||||||
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false)
|
bw = BolusWizard(injector).doCalc(profile, "", null, 20, 0.0, 5.4, 0.0, 100.0, true, true, true, true, false, false, false, false)
|
||||||
val bolusForBgInRange = bw.calculatedTotalInsulin
|
val bolusForBgInRange = bw.calculatedTotalInsulin
|
||||||
Assert.assertTrue(bolusForLowBg < bolusForBgInRange)
|
Assert.assertTrue(bolusForLowBg < bolusForBgInRange)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue