@@ -61,7 +61,7 @@ class RecommendTempBasalTests: XCTestCase {
6161 return fixture. map {
6262 return GlucoseFixtureValue (
6363 startDate: dateFormatter. date ( from: $0 [ " date " ] as! String ) !,
64- quantity: HKQuantity ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , doubleValue: $0 [ " amount " ] as! Double )
64+ quantity: HKQuantity ( unit: HKUnit . milligramsPerDeciliter ( ) , doubleValue: $0 [ " amount " ] as! Double )
6565 )
6666 }
6767 }
@@ -81,15 +81,15 @@ class RecommendTempBasalTests: XCTestCase {
8181 }
8282
8383 var glucoseTargetRange : GlucoseRangeSchedule {
84- return GlucoseRangeSchedule ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: TimeInterval ( 0 ) , value: DoubleRange ( minValue: 90 , maxValue: 120 ) ) ] , workoutRange: nil ) !
84+ return GlucoseRangeSchedule ( unit: HKUnit . milligramsPerDeciliter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: TimeInterval ( 0 ) , value: DoubleRange ( minValue: 90 , maxValue: 120 ) ) ] , workoutRange: nil ) !
8585 }
8686
8787 var insulinSensitivitySchedule : InsulinSensitivitySchedule {
88- return InsulinSensitivitySchedule ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 60.0 ) ] ) !
88+ return InsulinSensitivitySchedule ( unit: HKUnit . milligramsPerDeciliter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 60.0 ) ] ) !
8989 }
9090
9191 var minimumBGGuard : GlucoseThreshold {
92- return GlucoseThreshold ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , value: 55 )
92+ return GlucoseThreshold ( unit: HKUnit . milligramsPerDeciliter ( ) , value: 55 )
9393 }
9494
9595 var insulinActionDuration : TimeInterval {
@@ -385,7 +385,7 @@ class RecommendTempBasalTests: XCTestCase {
385385 XCTAssertEqual ( TimeInterval ( minutes: 30 ) , dose!. duration)
386386
387387 // Use mmol sensitivity value
388- let insulinSensitivitySchedule = InsulinSensitivitySchedule ( unit: HKUnit . millimolesPerLiterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 3.33 ) ] ) !
388+ let insulinSensitivitySchedule = InsulinSensitivitySchedule ( unit: HKUnit . millimolesPerLiter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 3.33 ) ] ) !
389389
390390 dose = DoseMath . recommendTempBasalFromPredictedGlucose ( glucose,
391391 atDate: glucose. first!. startDate,
@@ -465,7 +465,7 @@ class RecommendBolusTests: XCTestCase {
465465 return fixture. map {
466466 return GlucoseFixtureValue (
467467 startDate: dateFormatter. date ( from: $0 [ " date " ] as! String ) !,
468- quantity: HKQuantity ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , doubleValue: $0 [ " amount " ] as! Double )
468+ quantity: HKQuantity ( unit: HKUnit . milligramsPerDeciliter ( ) , doubleValue: $0 [ " amount " ] as! Double )
469469 )
470470 }
471471 }
@@ -485,15 +485,15 @@ class RecommendBolusTests: XCTestCase {
485485 }
486486
487487 var glucoseTargetRange : GlucoseRangeSchedule {
488- return GlucoseRangeSchedule ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: TimeInterval ( 0 ) , value: DoubleRange ( minValue: 90 , maxValue: 120 ) ) ] , workoutRange: nil ) !
488+ return GlucoseRangeSchedule ( unit: HKUnit . milligramsPerDeciliter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: TimeInterval ( 0 ) , value: DoubleRange ( minValue: 90 , maxValue: 120 ) ) ] , workoutRange: nil ) !
489489 }
490490
491491 var insulinSensitivitySchedule : InsulinSensitivitySchedule {
492- return InsulinSensitivitySchedule ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 60.0 ) ] ) !
492+ return InsulinSensitivitySchedule ( unit: HKUnit . milligramsPerDeciliter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 60.0 ) ] ) !
493493 }
494494
495495 var minimumBGGuard : GlucoseThreshold {
496- return GlucoseThreshold ( unit: HKUnit . milligramsPerDeciliterUnit ( ) , value: 55 )
496+ return GlucoseThreshold ( unit: HKUnit . milligramsPerDeciliter ( ) , value: 55 )
497497 }
498498
499499 var insulinActionDuration : TimeInterval {
@@ -589,13 +589,11 @@ class RecommendBolusTests: XCTestCase {
589589 XCTAssertEqual ( 1.325 , dose. amount)
590590
591591 if case BolusRecommendationNotice . currentGlucoseBelowTarget( let glucose, let units) = dose. notice! {
592- XCTAssertEqual ( units, HKUnit . milligramsPerDeciliterUnit ( ) )
592+ XCTAssertEqual ( units, HKUnit . milligramsPerDeciliter ( ) )
593593 XCTAssertEqual ( glucose. quantity. doubleValue ( for: units) , 60 )
594594 } else {
595595 XCTFail ( " Expected currentGlucoseBelowTarget, but got \( dose. notice!) " )
596596 }
597-
598- //XCTAssertEqual(BolusRecommendationNotice.currentGlucoseBelowTarget(glucose: GlucoseValue(56), unit: HKUnit.milligramsPerDeciliterUnit()), dose.notice!)
599597 }
600598
601599 func testDroppingBelowRangeThenRising( ) {
@@ -747,7 +745,7 @@ class RecommendBolusTests: XCTestCase {
747745 XCTAssertEqual ( 1.0 , dose. amount)
748746
749747 // Use mmol sensitivity value
750- let insulinSensitivitySchedule = InsulinSensitivitySchedule ( unit: HKUnit . millimolesPerLiterUnit ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 10.0 / 3 ) ] ) !
748+ let insulinSensitivitySchedule = InsulinSensitivitySchedule ( unit: HKUnit . millimolesPerLiter ( ) , dailyItems: [ RepeatingScheduleValue ( startTime: 0.0 , value: 10.0 / 3 ) ] ) !
751749
752750 dose = DoseMath . recommendBolusFromPredictedGlucose ( glucose,
753751 atDate: glucose. first!. startDate,
0 commit comments