|
...
|
...
|
@@ -457,9 +457,7 @@ void main() { |
|
|
|
});
|
|
|
|
|
|
|
|
group('LocalHealthDataConvert activity unit conversion', () {
|
|
|
|
test(
|
|
|
|
'passes through exercise seconds and stand hours from raw activity data',
|
|
|
|
() {
|
|
|
|
test('uses ceiled kcal move values and raw exercise/stand units', () {
|
|
|
|
final day = DateTime(2026, 7, 16);
|
|
|
|
final endTime = LocalHealthDataConvert.unixSeconds(
|
|
|
|
day.add(const Duration(hours: 12)),
|
|
...
|
...
|
@@ -468,8 +466,8 @@ void main() { |
|
|
|
HealthKitRawActivityDataPoint(
|
|
|
|
endTime: endTime,
|
|
|
|
activityMoveMode: 0,
|
|
|
|
activeEnergyBurned: 300,
|
|
|
|
activeEnergyBurnedGoal: 500,
|
|
|
|
activeEnergyBurned: 300.1,
|
|
|
|
activeEnergyBurnedGoal: 500.1,
|
|
|
|
appleMoveTime: 8000,
|
|
|
|
appleMoveTimeGoal: 10000,
|
|
|
|
appleExerciseTime: 1800,
|
|
...
|
...
|
@@ -499,13 +497,19 @@ void main() { |
|
|
|
sleepIntervals: const [],
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(healthData.move, 301);
|
|
|
|
expect(healthData.exercise, 1800);
|
|
|
|
expect(healthData.stand, 6);
|
|
|
|
expect(target.move, 501);
|
|
|
|
expect(target.exercise, 3600);
|
|
|
|
expect(target.stand, 12);
|
|
|
|
expect(statistics.totalMove, 301);
|
|
|
|
expect(statistics.avgMove, 301);
|
|
|
|
expect(statistics.moveTrendList?.single.value, 301);
|
|
|
|
expect(statistics.overallList?.single.value?.move, 301);
|
|
|
|
expect(statistics.totalExercise, 1800);
|
|
|
|
expect(statistics.totalStand, 6);
|
|
|
|
expect(statistics.activityTargetInfo?.move, 500);
|
|
|
|
expect(statistics.activityTargetInfo?.move, 501);
|
|
|
|
expect(statistics.activityTargetInfo?.exercise, 3600);
|
|
|
|
expect(statistics.activityTargetInfo?.stand, 12);
|
|
|
|
});
|
|
...
|
...
|
@@ -526,7 +530,7 @@ void main() { |
|
|
|
endTime: LocalHealthDataConvert.unixSeconds(
|
|
|
|
secondDay.add(const Duration(hours: 12)),
|
|
|
|
),
|
|
|
|
activeEnergyBurnedGoal: 600,
|
|
|
|
activeEnergyBurnedGoal: 600.1,
|
|
|
|
exerciseTimeGoal: 0,
|
|
|
|
standHoursGoal: null,
|
|
|
|
),
|
|
...
|
...
|
@@ -540,7 +544,7 @@ void main() { |
|
|
|
sleepIntervals: const [],
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(statistics.activityTargetInfo?.move, 600);
|
|
|
|
expect(statistics.activityTargetInfo?.move, 601);
|
|
|
|
expect(statistics.activityTargetInfo?.exercise, 3600);
|
|
|
|
expect(statistics.activityTargetInfo?.stand, 12);
|
|
|
|
});
|
...
|
...
|
|