Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adding HealthKit Sample metadata #18

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ extension OCKHealthKitPassthroughStore {

outcomeValue.startDate = sample.dateInterval.start
outcomeValue.endDate = sample.dateInterval.end
outcomeValue.sourceRevision = sample.sourceRevision
outcomeValue.device = sample.device
outcomeValue.metadata = sample.metadata

var updatedEvent = event

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ class TestHealthKitPassthroughStoreEvents: XCTestCase {
id: UUID(),
type: HKObjectType.quantityType(forIdentifier: heartRateTask.healthKitLinkage.quantityIdentifier)!,
quantity: HKQuantity(unit: heartRateTask.healthKitLinkage.unit, doubleValue: $0),
dateInterval: DateInterval(start: heartRateStart, end: heartRateEnd)
dateInterval: DateInterval(start: heartRateStart, end: heartRateEnd),
sourceRevision: heartRateSourceRevision,
device: heartRateDevice,
metadata: heartRateMetadata
)
}

Expand Down Expand Up @@ -155,9 +158,15 @@ class TestHealthKitPassthroughStoreEvents: XCTestCase {
XCTAssertEqual(outcomeValues.first?.doubleValue, 70)
XCTAssertEqual(outcomeValues.first?.startDate, heartRateStart)
XCTAssertEqual(outcomeValues.first?.endDate, heartRateEnd)
XCTAssertEqual(outcomeValues.first?.sourceRevision, heartRateSourceRevision)
XCTAssertEqual(outcomeValues.first?.device, heartRateDevice)
XCTAssertEqual(outcomeValues.first?.metadata, heartRateMetadata)
XCTAssertEqual(outcomeValues.last?.doubleValue, 80)
XCTAssertEqual(outcomeValues.last?.startDate, heartRateStart)
XCTAssertEqual(outcomeValues.last?.endDate, heartRateEnd)
XCTAssertEqual(outcomeValues.last?.sourceRevision, heartRateSourceRevision)
XCTAssertEqual(outcomeValues.last?.device, heartRateDevice)
XCTAssertEqual(outcomeValues.last?.metadata, heartRateMetadata)

default:
XCTFail("Unexpected task")
Expand Down
Loading