Skip to content

Commit

Permalink
Merge pull request #206 from loopandlearn/restore_tests
Browse files Browse the repository at this point in the history
Restore tests (replaces PR #147)
  • Loading branch information
MikePlante1 authored May 23, 2024
2 parents 30e4f53 + bf83819 commit 5671755
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 8 additions & 8 deletions FreeAPS.xcodeproj/xcshareddata/xcschemes/Trio.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "43CABDFC1C3506F100005705"
Expand All @@ -273,7 +273,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C17F50CD291EAC3800555EB5"
Expand All @@ -283,7 +283,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "43D8FDD41C728FDF0073BE78"
Expand All @@ -293,7 +293,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B4CEE2DF257129780093111B"
Expand All @@ -303,7 +303,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C13CC34029C7B73A007F25DE"
Expand All @@ -313,7 +313,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84752E8A26ED0FFE009FD801"
Expand All @@ -323,7 +323,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C12ED9C929C7DBA900435701"
Expand All @@ -333,7 +333,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "431CE7761F98564200255374"
Expand Down
14 changes: 9 additions & 5 deletions FreeAPSTests/CalibrationsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class CalibrationsTests: XCTestCase, Injectable {
}

func testCreateSimpleCalibration() {
// restore state so each test is independent
calibrationService.removeAllCalibrations()

let calibration = Calibration(x: 100.0, y: 102.0)
calibrationService.addCalibration(calibration)

Expand All @@ -25,17 +28,18 @@ class CalibrationsTests: XCTestCase, Injectable {
}

func testCreateMultipleCalibration() {
// restore state so each test is independent
calibrationService.removeAllCalibrations()

let calibration = Calibration(x: 100.0, y: 120)
calibrationService.addCalibration(calibration)

let calibration2 = Calibration(x: 120.0, y: 130.0)
calibrationService.addCalibration(calibration2)

XCTAssertTrue(calibrationService.slope == 0.8)

XCTAssertTrue(calibrationService.intercept == 37)

XCTAssertTrue(calibrationService.calibrate(value: 80) == 101)
XCTAssertEqual(calibrationService.slope, 0.8, accuracy: 0.0001)
XCTAssertEqual(calibrationService.intercept, 37, accuracy: 0.0001)
XCTAssertEqual(calibrationService.calibrate(value: 80), 101, accuracy: 0.0001)

calibrationService.removeLast()

Expand Down

0 comments on commit 5671755

Please sign in to comment.