|
|
@@ -64,8 +64,7 @@ import Testing
|
|
|
start: 0,
|
|
|
end: 0,
|
|
|
smbMinutes: 0,
|
|
|
- uamMinutes: 0,
|
|
|
- shouldProtectDueToHIGH: false
|
|
|
+ uamMinutes: 0
|
|
|
)
|
|
|
|
|
|
return (
|
|
|
@@ -110,21 +109,6 @@ import Testing
|
|
|
#expect(decision.isEnabled == false)
|
|
|
}
|
|
|
|
|
|
- @Test("Should disable SMB when shouldProtectDueToHIGH is true") func disableWhenProtectDueToHigh() throws {
|
|
|
- var inputs = createDefaultInputs()
|
|
|
- inputs.trioCustomOrefVariables.shouldProtectDueToHIGH = true
|
|
|
- inputs.profile.enableSMBAlways = true // Ensure protection takes precedence
|
|
|
-
|
|
|
- let decision = try DosingEngine.makeSMBDosingDecision(
|
|
|
- profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
|
|
|
- adjustedTargetGlucose: inputs.adjustedTargetGlucose,
|
|
|
- minGuardGlucose: inputs.minGuardGlucose,
|
|
|
- threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
|
|
|
- trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
|
|
|
- )
|
|
|
- #expect(decision.isEnabled == false)
|
|
|
- }
|
|
|
-
|
|
|
@Test("Should disable SMB with high temp target when not allowed") func disableWithHighTempTarget() throws {
|
|
|
var inputs = createDefaultInputs()
|
|
|
inputs.profile.allowSMBWithHighTemptarget = false
|