[healthkit] Add nullability to (generated and manual) bindings (#14730)
* remove null ignores and add nullability * throw better exception * use is null * remove extra ignores * Add the tests * use a progma ignore instead * revert monotouch-test.csproj Co-authored-by: tj_devel709 <antlambe@microsoft.com>
This commit is contained in:
Родитель
717b141f16
Коммит
6dc0eed0a8
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
#if !NET
|
||||
|
||||
using System;
|
||||
|
@ -8,7 +10,7 @@ namespace HealthKit {
|
|||
[Obsolete ("Use the 'HKQuantityTypeIdentifier' enum instead.")]
|
||||
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
|
||||
public unsafe static partial class HKQuantityTypeIdentifierKey {
|
||||
public static NSString ActiveEnergyBurned {
|
||||
public static NSString? ActiveEnergyBurned {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.ActiveEnergyBurned);
|
||||
}
|
||||
|
@ -16,309 +18,309 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 9,3, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 2,2, PlatformArchitecture.All)]
|
||||
public static NSString AppleExerciseTime {
|
||||
public static NSString? AppleExerciseTime {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.AppleExerciseTime);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString BasalBodyTemperature {
|
||||
public static NSString? BasalBodyTemperature {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BasalBodyTemperature);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BasalEnergyBurned {
|
||||
public static NSString? BasalEnergyBurned {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BasalEnergyBurned);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BloodAlcoholContent {
|
||||
public static NSString? BloodAlcoholContent {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BloodAlcoholContent);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BloodGlucose {
|
||||
public static NSString? BloodGlucose {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BloodGlucose);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BloodPressureDiastolic {
|
||||
public static NSString? BloodPressureDiastolic {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BloodPressureDiastolic);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BloodPressureSystolic {
|
||||
public static NSString? BloodPressureSystolic {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BloodPressureSystolic);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BodyFatPercentage {
|
||||
public static NSString? BodyFatPercentage {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BodyFatPercentage);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BodyMass {
|
||||
public static NSString? BodyMass {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BodyMass);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BodyMassIndex {
|
||||
public static NSString? BodyMassIndex {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BodyMassIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BodyTemperature {
|
||||
public static NSString? BodyTemperature {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.BodyTemperature);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryBiotin {
|
||||
public static NSString? DietaryBiotin {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryBiotin);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryCaffeine {
|
||||
public static NSString? DietaryCaffeine {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryCaffeine);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryCalcium {
|
||||
public static NSString? DietaryCalcium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryCalcium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryCarbohydrates {
|
||||
public static NSString? DietaryCarbohydrates {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryCarbohydrates);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryChloride {
|
||||
public static NSString? DietaryChloride {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryChloride);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryCholesterol {
|
||||
public static NSString? DietaryCholesterol {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryCholesterol);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryChromium {
|
||||
public static NSString? DietaryChromium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryChromium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryCopper {
|
||||
public static NSString? DietaryCopper {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryCopper);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryEnergyConsumed {
|
||||
public static NSString? DietaryEnergyConsumed {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryEnergyConsumed);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFatMonounsaturated {
|
||||
public static NSString? DietaryFatMonounsaturated {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFatMonounsaturated);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFatPolyunsaturated {
|
||||
public static NSString? DietaryFatPolyunsaturated {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFatPolyunsaturated);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFatSaturated {
|
||||
public static NSString? DietaryFatSaturated {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFatSaturated);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFatTotal {
|
||||
public static NSString? DietaryFatTotal {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFatTotal);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFiber {
|
||||
public static NSString? DietaryFiber {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFiber);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryFolate {
|
||||
public static NSString? DietaryFolate {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryFolate);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryIodine {
|
||||
public static NSString? DietaryIodine {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryIodine);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryIron {
|
||||
public static NSString? DietaryIron {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryIron);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryMagnesium {
|
||||
public static NSString? DietaryMagnesium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryMagnesium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryManganese {
|
||||
public static NSString? DietaryManganese {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryManganese);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryMolybdenum {
|
||||
public static NSString? DietaryMolybdenum {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryMolybdenum);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryNiacin {
|
||||
public static NSString? DietaryNiacin {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryNiacin);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryPantothenicAcid {
|
||||
public static NSString? DietaryPantothenicAcid {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryPantothenicAcid);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryPhosphorus {
|
||||
public static NSString? DietaryPhosphorus {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryPhosphorus);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryPotassium {
|
||||
public static NSString? DietaryPotassium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryPotassium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryProtein {
|
||||
public static NSString? DietaryProtein {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryProtein);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryRiboflavin {
|
||||
public static NSString? DietaryRiboflavin {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryRiboflavin);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietarySelenium {
|
||||
public static NSString? DietarySelenium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietarySelenium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietarySodium {
|
||||
public static NSString? DietarySodium {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietarySodium);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietarySugar {
|
||||
public static NSString? DietarySugar {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietarySugar);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryThiamin {
|
||||
public static NSString? DietaryThiamin {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryThiamin);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminA {
|
||||
public static NSString? DietaryVitaminA {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminA);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminB12 {
|
||||
public static NSString? DietaryVitaminB12 {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminB12);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminB6 {
|
||||
public static NSString? DietaryVitaminB6 {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminB6);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminC {
|
||||
public static NSString? DietaryVitaminC {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminC);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminD {
|
||||
public static NSString? DietaryVitaminD {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminD);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminE {
|
||||
public static NSString? DietaryVitaminE {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminE);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryVitaminK {
|
||||
public static NSString? DietaryVitaminK {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryVitaminK);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString DietaryWater {
|
||||
public static NSString? DietaryWater {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryWater);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DietaryZinc {
|
||||
public static NSString? DietaryZinc {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DietaryZinc);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DistanceCycling {
|
||||
public static NSString? DistanceCycling {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DistanceCycling);
|
||||
}
|
||||
|
@ -326,7 +328,7 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.WatchOS, 4,2, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.iOS, 11,2, PlatformArchitecture.All)]
|
||||
public static NSString DistanceDownhillSnowSports {
|
||||
public static NSString? DistanceDownhillSnowSports {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DistanceDownhillSnowSports);
|
||||
}
|
||||
|
@ -334,13 +336,13 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString DistanceSwimming {
|
||||
public static NSString? DistanceSwimming {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DistanceSwimming);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DistanceWalkingRunning {
|
||||
public static NSString? DistanceWalkingRunning {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DistanceWalkingRunning);
|
||||
}
|
||||
|
@ -348,37 +350,37 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString DistanceWheelchair {
|
||||
public static NSString? DistanceWheelchair {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.DistanceWheelchair);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString ElectrodermalActivity {
|
||||
public static NSString? ElectrodermalActivity {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.ElectrodermalActivity);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString FlightsClimbed {
|
||||
public static NSString? FlightsClimbed {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.FlightsClimbed);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString ForcedExpiratoryVolume1 {
|
||||
public static NSString? ForcedExpiratoryVolume1 {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.ForcedExpiratoryVolume1);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString ForcedVitalCapacity {
|
||||
public static NSString? ForcedVitalCapacity {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.ForcedVitalCapacity);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString HeartRate {
|
||||
public static NSString? HeartRate {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.HeartRate);
|
||||
}
|
||||
|
@ -386,19 +388,19 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
public static NSString HeartRateVariabilitySdnn {
|
||||
public static NSString? HeartRateVariabilitySdnn {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.HeartRateVariabilitySdnn);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString Height {
|
||||
public static NSString? Height {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.Height);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString InhalerUsage {
|
||||
public static NSString? InhalerUsage {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.InhalerUsage);
|
||||
}
|
||||
|
@ -406,43 +408,43 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
public static NSString InsulinDelivery {
|
||||
public static NSString? InsulinDelivery {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.InsulinDelivery);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString LeanBodyMass {
|
||||
public static NSString? LeanBodyMass {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.LeanBodyMass);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString NikeFuel {
|
||||
public static NSString? NikeFuel {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.NikeFuel);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString NumberOfTimesFallen {
|
||||
public static NSString? NumberOfTimesFallen {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.NumberOfTimesFallen);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString OxygenSaturation {
|
||||
public static NSString? OxygenSaturation {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.OxygenSaturation);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString PeakExpiratoryFlowRate {
|
||||
public static NSString? PeakExpiratoryFlowRate {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.PeakExpiratoryFlowRate);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString PeripheralPerfusionIndex {
|
||||
public static NSString? PeripheralPerfusionIndex {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.PeripheralPerfusionIndex);
|
||||
}
|
||||
|
@ -450,13 +452,13 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString PushCount {
|
||||
public static NSString? PushCount {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.PushCount);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString RespiratoryRate {
|
||||
public static NSString? RespiratoryRate {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.RespiratoryRate);
|
||||
}
|
||||
|
@ -464,13 +466,13 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
public static NSString RestingHeartRate {
|
||||
public static NSString? RestingHeartRate {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.RestingHeartRate);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString StepCount {
|
||||
public static NSString? StepCount {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.StepCount);
|
||||
}
|
||||
|
@ -478,14 +480,14 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString SwimmingStrokeCount {
|
||||
public static NSString? SwimmingStrokeCount {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.SwimmingStrokeCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString UVExposure {
|
||||
public static NSString? UVExposure {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.UVExposure);
|
||||
}
|
||||
|
@ -493,7 +495,7 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
public static NSString VO2Max {
|
||||
public static NSString? VO2Max {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.VO2Max);
|
||||
}
|
||||
|
@ -501,7 +503,7 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
public static NSString WaistCircumference {
|
||||
public static NSString? WaistCircumference {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.WaistCircumference);
|
||||
}
|
||||
|
@ -509,7 +511,7 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 11,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 4,0, PlatformArchitecture.All)]
|
||||
public static NSString WalkingHeartRateAverage {
|
||||
public static NSString? WalkingHeartRateAverage {
|
||||
get {
|
||||
return HKQuantityTypeIdentifierExtensions.GetConstant (HKQuantityTypeIdentifier.WalkingHeartRateAverage);
|
||||
}
|
||||
|
@ -520,28 +522,28 @@ namespace HealthKit {
|
|||
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
|
||||
public unsafe static partial class HKCategoryTypeIdentifierKey {
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString AppleStandHour {
|
||||
public static NSString? AppleStandHour {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.AppleStandHour);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString CervicalMucusQuality {
|
||||
public static NSString? CervicalMucusQuality {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.CervicalMucusQuality);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString IntermenstrualBleeding {
|
||||
public static NSString? IntermenstrualBleeding {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.IntermenstrualBleeding);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString MenstrualFlow {
|
||||
public static NSString? MenstrualFlow {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.MenstrualFlow);
|
||||
}
|
||||
|
@ -549,27 +551,27 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString MindfulSession {
|
||||
public static NSString? MindfulSession {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.MindfulSession);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString OvulationTestResult {
|
||||
public static NSString? OvulationTestResult {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.OvulationTestResult);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString SexualActivity {
|
||||
public static NSString? SexualActivity {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.SexualActivity);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString SleepAnalysis {
|
||||
public static NSString? SleepAnalysis {
|
||||
get {
|
||||
return HKCategoryTypeIdentifierExtensions.GetConstant (HKCategoryTypeIdentifier.SleepAnalysis);
|
||||
}
|
||||
|
@ -579,26 +581,26 @@ namespace HealthKit {
|
|||
[Obsolete ("Use the 'HKCharacteristicTypeIdentifier' enum instead.")]
|
||||
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
|
||||
public unsafe static partial class HKCharacteristicTypeIdentifierKey {
|
||||
public static NSString BiologicalSex {
|
||||
public static NSString? BiologicalSex {
|
||||
get {
|
||||
return HKCharacteristicTypeIdentifierExtensions.GetConstant (HKCharacteristicTypeIdentifier.BiologicalSex);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString BloodType {
|
||||
public static NSString? BloodType {
|
||||
get {
|
||||
return HKCharacteristicTypeIdentifierExtensions.GetConstant (HKCharacteristicTypeIdentifier.BloodType);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString DateOfBirth {
|
||||
public static NSString? DateOfBirth {
|
||||
get {
|
||||
return HKCharacteristicTypeIdentifierExtensions.GetConstant (HKCharacteristicTypeIdentifier.DateOfBirth);
|
||||
}
|
||||
}
|
||||
|
||||
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
|
||||
public static NSString FitzpatrickSkinType {
|
||||
public static NSString? FitzpatrickSkinType {
|
||||
get {
|
||||
return HKCharacteristicTypeIdentifierExtensions.GetConstant (HKCharacteristicTypeIdentifier.FitzpatrickSkinType);
|
||||
}
|
||||
|
@ -606,7 +608,7 @@ namespace HealthKit {
|
|||
|
||||
[Introduced (PlatformName.iOS, 10,0, PlatformArchitecture.All)]
|
||||
[Introduced (PlatformName.WatchOS, 3,0, PlatformArchitecture.All)]
|
||||
public static NSString WheelchairUse {
|
||||
public static NSString? WheelchairUse {
|
||||
get {
|
||||
return HKCharacteristicTypeIdentifierExtensions.GetConstant (HKCharacteristicTypeIdentifier.WheelchairUse);
|
||||
}
|
||||
|
@ -616,13 +618,13 @@ namespace HealthKit {
|
|||
[Obsolete ("Use the 'HKCorrelationType' enum instead.")]
|
||||
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
|
||||
public unsafe static partial class HKCorrelationTypeKey {
|
||||
public static NSString IdentifierBloodPressure {
|
||||
public static NSString? IdentifierBloodPressure {
|
||||
get {
|
||||
return HKCorrelationTypeIdentifierExtensions.GetConstant (HKCorrelationTypeIdentifier.BloodPressure);
|
||||
}
|
||||
}
|
||||
|
||||
public static NSString IdentifierFood {
|
||||
public static NSString? IdentifierFood {
|
||||
get {
|
||||
return HKCorrelationTypeIdentifierExtensions.GetConstant (HKCorrelationTypeIdentifier.Food);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
namespace HealthKit {
|
||||
|
|
|
@ -24,8 +24,8 @@ namespace HealthKit {
|
|||
|
||||
public static bool TryGetClassification (HKQuantity value, out HKAppleWalkingSteadinessClassification? classification, out NSError? error)
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException (nameof (value));
|
||||
if (value is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value));
|
||||
classification = null;
|
||||
error = null;
|
||||
if (HKAppleWalkingSteadinessClassificationForQuantity (value.GetHandle (), out var classificationOut, out var errorPtr)) {
|
||||
|
|
|
@ -9,41 +9,47 @@
|
|||
//
|
||||
// Copyright 2014-2015 Xamarin
|
||||
//
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Foundation;
|
||||
namespace HealthKit
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
public partial class HKQuantityType {
|
||||
public static HKQuantityType Create (HKQuantityTypeIdentifier kind)
|
||||
public static HKQuantityType? Create (HKQuantityTypeIdentifier kind)
|
||||
{
|
||||
return HKObjectType.GetQuantityType (kind.GetConstant ());
|
||||
}
|
||||
}
|
||||
|
||||
public partial class HKCategoryType {
|
||||
public static HKCategoryType Create (HKCategoryTypeIdentifier kind)
|
||||
public static HKCategoryType? Create (HKCategoryTypeIdentifier kind)
|
||||
{
|
||||
return HKObjectType.GetCategoryType (kind.GetConstant ());
|
||||
}
|
||||
}
|
||||
|
||||
public partial class HKCharacteristicType {
|
||||
public static HKCharacteristicType Create (HKCharacteristicTypeIdentifier kind)
|
||||
public static HKCharacteristicType? Create (HKCharacteristicTypeIdentifier kind)
|
||||
{
|
||||
return HKObjectType.GetCharacteristicType (kind.GetConstant ());
|
||||
}
|
||||
}
|
||||
|
||||
public partial class HKCorrelationType {
|
||||
public static HKCorrelationType Create (HKCorrelationTypeIdentifier kind)
|
||||
public static HKCorrelationType? Create (HKCorrelationTypeIdentifier kind)
|
||||
{
|
||||
return HKObjectType.GetCorrelationType (kind.GetConstant ());
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
|
||||
#if !WATCH
|
||||
public partial class HKDocumentType {
|
||||
public static HKDocumentType Create (HKDocumentTypeIdentifier kind)
|
||||
public static HKDocumentType? Create (HKDocumentTypeIdentifier kind)
|
||||
{
|
||||
return HKObjectType._GetDocumentType (kind.GetConstant ());
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
namespace HealthKit {
|
||||
|
@ -17,7 +19,7 @@ namespace HealthKit {
|
|||
}
|
||||
|
||||
[Obsolete ("Use 'StatisticsUpdated', this handler uses an incorrect type and does nothing to avoid a crash.")]
|
||||
public virtual HKStatisticsCollectionQueryInitialResultsHandler StatisticsUpdateHandler {
|
||||
public virtual HKStatisticsCollectionQueryInitialResultsHandler? StatisticsUpdateHandler {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +27,7 @@ namespace HealthKit {
|
|||
public partial class HKObjectType {
|
||||
|
||||
[Obsolete ("Use 'GetWorkoutType', it will return a valid HKWorkoutType instance.")]
|
||||
static public HKWorkout WorkoutType ()
|
||||
static public HKWorkout? WorkoutType ()
|
||||
{
|
||||
// would throw an InvalidCastException since the old selector returned a HKWorkoutType
|
||||
return null;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
namespace HealthKit {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
namespace HealthKit
|
||||
|
|
|
@ -486,7 +486,7 @@ namespace HealthKit {
|
|||
[Export ("correlationType", ArgumentSemantic.Copy)]
|
||||
HKCorrelationType CorrelationType { get; }
|
||||
|
||||
[Export ("samplePredicates", ArgumentSemantic.Copy)]
|
||||
[NullAllowed, Export ("samplePredicates", ArgumentSemantic.Copy)]
|
||||
NSDictionary SamplePredicates { get; }
|
||||
}
|
||||
|
||||
|
@ -587,10 +587,12 @@ namespace HealthKit {
|
|||
|
||||
// FIXME NS_EXTENSION_UNAVAILABLE("Not available to extensions") ;
|
||||
[Export ("biologicalSexWithError:")]
|
||||
[return: NullAllowed]
|
||||
HKBiologicalSexObject GetBiologicalSex (out NSError error);
|
||||
|
||||
// FIXME NS_EXTENSION_UNAVAILABLE("Not available to extensions") ;
|
||||
[Export ("bloodTypeWithError:")]
|
||||
[return: NullAllowed]
|
||||
HKBloodTypeObject GetBloodType (out NSError error);
|
||||
|
||||
[Watch (8,0)]
|
||||
|
@ -1068,7 +1070,7 @@ namespace HealthKit {
|
|||
[Export ("source", ArgumentSemantic.Strong)]
|
||||
HKSource Source { get; }
|
||||
|
||||
[Export ("metadata", ArgumentSemantic.Copy)]
|
||||
[NullAllowed, Export ("metadata", ArgumentSemantic.Copy)]
|
||||
NSDictionary WeakMetadata { get; }
|
||||
|
||||
[Wrap ("WeakMetadata")]
|
||||
|
@ -1103,7 +1105,7 @@ namespace HealthKit {
|
|||
[Static]
|
||||
[Export ("quantityTypeForIdentifier:")]
|
||||
[return: NullAllowed]
|
||||
HKQuantityType GetQuantityType (NSString hkTypeIdentifier);
|
||||
HKQuantityType GetQuantityType ([NullAllowed] NSString hkTypeIdentifier);
|
||||
|
||||
#if NET || WATCH
|
||||
[Internal]
|
||||
|
@ -1113,7 +1115,7 @@ namespace HealthKit {
|
|||
[Static]
|
||||
[Export ("categoryTypeForIdentifier:")]
|
||||
[return: NullAllowed]
|
||||
HKCategoryType GetCategoryType (NSString hkCategoryTypeIdentifier);
|
||||
HKCategoryType GetCategoryType ([NullAllowed] NSString hkCategoryTypeIdentifier);
|
||||
|
||||
#if NET || WATCH
|
||||
[Internal]
|
||||
|
@ -1123,7 +1125,7 @@ namespace HealthKit {
|
|||
[Static]
|
||||
[Export ("characteristicTypeForIdentifier:")]
|
||||
[return: NullAllowed]
|
||||
HKCharacteristicType GetCharacteristicType (NSString hkCharacteristicTypeIdentifier);
|
||||
HKCharacteristicType GetCharacteristicType ([NullAllowed] NSString hkCharacteristicTypeIdentifier);
|
||||
|
||||
#if NET || WATCH
|
||||
[Internal]
|
||||
|
@ -1132,7 +1134,7 @@ namespace HealthKit {
|
|||
#endif
|
||||
[Static, Export ("correlationTypeForIdentifier:")]
|
||||
[return: NullAllowed]
|
||||
HKCorrelationType GetCorrelationType (NSString hkCorrelationTypeIdentifier);
|
||||
HKCorrelationType GetCorrelationType ([NullAllowed] NSString hkCorrelationTypeIdentifier);
|
||||
|
||||
[NoWatch] // HKDocumentType is iOS only, rdar #27865614
|
||||
[iOS (10,0)]
|
||||
|
@ -1140,7 +1142,7 @@ namespace HealthKit {
|
|||
[Static]
|
||||
[Export ("documentTypeForIdentifier:")]
|
||||
[return: NullAllowed]
|
||||
HKDocumentType _GetDocumentType (NSString hkDocumentTypeIdentifier);
|
||||
HKDocumentType _GetDocumentType ([NullAllowed] NSString hkDocumentTypeIdentifier);
|
||||
|
||||
[Static, Export ("workoutType")]
|
||||
#if NET
|
||||
|
@ -1350,7 +1352,7 @@ namespace HealthKit {
|
|||
[NullAllowed, Export ("sampleType", ArgumentSemantic.Strong)]
|
||||
HKSampleType SampleType { get; }
|
||||
|
||||
[Export ("predicate", ArgumentSemantic.Strong)]
|
||||
[NullAllowed, Export ("predicate", ArgumentSemantic.Strong)]
|
||||
NSPredicate Predicate { get; }
|
||||
|
||||
// HKQuery (HKObjectPredicates) Category
|
||||
|
@ -1548,7 +1550,7 @@ namespace HealthKit {
|
|||
[Export ("limit")]
|
||||
nuint Limit { get; }
|
||||
|
||||
[Export ("sortDescriptors")]
|
||||
[NullAllowed, Export ("sortDescriptors")]
|
||||
NSSortDescriptor[] SortDescriptors { get; }
|
||||
|
||||
[Export ("initWithSampleType:predicate:limit:sortDescriptors:resultsHandler:")]
|
||||
|
@ -1605,31 +1607,39 @@ namespace HealthKit {
|
|||
[Export ("endDate", ArgumentSemantic.Strong)]
|
||||
NSDate EndDate { get; }
|
||||
|
||||
[Export ("sources")]
|
||||
[NullAllowed, Export ("sources")]
|
||||
HKSource [] Sources { get; }
|
||||
|
||||
[Export ("averageQuantityForSource:")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity AverageQuantity (HKSource source);
|
||||
|
||||
[Export ("averageQuantity")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity AverageQuantity ();
|
||||
|
||||
[Export ("minimumQuantityForSource:")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity MinimumQuantity (HKSource source);
|
||||
|
||||
[Export ("minimumQuantity")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity MinimumQuantity ();
|
||||
|
||||
[Export ("maximumQuantityForSource:")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity MaximumQuantity (HKSource source);
|
||||
|
||||
[Export ("maximumQuantity")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity MaximumQuantity ();
|
||||
|
||||
[Export ("sumQuantityForSource:")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity SumQuantity (HKSource source);
|
||||
|
||||
[Export ("sumQuantity")]
|
||||
[return: NullAllowed]
|
||||
HKQuantity SumQuantity ();
|
||||
|
||||
[Watch (5,0), iOS (12,0)]
|
||||
|
@ -1669,6 +1679,7 @@ namespace HealthKit {
|
|||
interface HKStatisticsCollection {
|
||||
|
||||
[Export ("statisticsForDate:")]
|
||||
[return: NullAllowed]
|
||||
HKStatistics GetStatistics (NSDate date);
|
||||
|
||||
[Export ("enumerateStatisticsFromDate:toDate:withBlock:")]
|
||||
|
@ -2642,16 +2653,16 @@ namespace HealthKit {
|
|||
[Export ("workoutActivityType")]
|
||||
HKWorkoutActivityType WorkoutActivityType { get; }
|
||||
|
||||
[Export ("workoutEvents")]
|
||||
[NullAllowed, Export ("workoutEvents")]
|
||||
HKWorkoutEvent [] WorkoutEvents { get; }
|
||||
|
||||
[Export ("duration", ArgumentSemantic.UnsafeUnretained)]
|
||||
double Duration { get; }
|
||||
|
||||
[Export ("totalEnergyBurned", ArgumentSemantic.Retain)]
|
||||
[NullAllowed, Export ("totalEnergyBurned", ArgumentSemantic.Retain)]
|
||||
HKQuantity TotalEnergyBurned { get; }
|
||||
|
||||
[Export ("totalDistance", ArgumentSemantic.Retain)]
|
||||
[NullAllowed, Export ("totalDistance", ArgumentSemantic.Retain)]
|
||||
HKQuantity TotalDistance { get; }
|
||||
|
||||
[Watch (3,0), iOS (10,0)]
|
||||
|
@ -3291,6 +3302,7 @@ namespace HealthKit {
|
|||
HKStatistics GetStatistics (HKQuantityType quantityType);
|
||||
|
||||
[Export ("seriesBuilderForType:")]
|
||||
[return: NullAllowed]
|
||||
HKSeriesBuilder GetSeriesBuilder (HKSeriesType seriesType);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// Unit tests for HKHealthStore
|
||||
//
|
||||
// Authors:
|
||||
// TJ Lambert <TJ.Lambert@microsoft.com>
|
||||
//
|
||||
// Copyright 2022 Xamarin Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#if HAS_HEALTHKIT
|
||||
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using HealthKit;
|
||||
using UIKit;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTouchFixtures.HealthKit {
|
||||
|
||||
[TestFixture]
|
||||
[Preserve (AllMembers = true)]
|
||||
public class HKHealthStoreTest {
|
||||
|
||||
[Test]
|
||||
public void GetBiologicalSexNullReturnTest ()
|
||||
{
|
||||
var store = new HKHealthStore ();
|
||||
var ret = store.GetBiologicalSex (out _);
|
||||
Assert.IsNull (ret, "GetBiologicalSex should return a null value if biological sex is not set.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetBloodTypeNullReturnTest ()
|
||||
{
|
||||
var store = new HKHealthStore ();
|
||||
var ret = store.GetBloodType (out _);
|
||||
Assert.IsNull (ret, "GetBloodType should return a null value if blood type is not set.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // HAS_HEALTHKIT
|
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// Unit tests for HKWorkoutBuilder
|
||||
//
|
||||
// Authors:
|
||||
// TJ Lambert <TJ.Lambert@microsoft.com>
|
||||
//
|
||||
// Copyright 2022 Xamarin Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#if HAS_HEALTHKIT
|
||||
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using HealthKit;
|
||||
using UIKit;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTouchFixtures.HealthKit {
|
||||
|
||||
[TestFixture]
|
||||
[Preserve (AllMembers = true)]
|
||||
public class HKWorkoutBuilderTest {
|
||||
|
||||
[Test]
|
||||
public void GetSeriesBuilderNullReturnTest ()
|
||||
{
|
||||
var store = new HKHealthStore ();
|
||||
var seriesBuilder = new HKWorkoutBuilder (new HKHealthStore (), new HKWorkoutConfiguration (), HKDevice.LocalDevice);
|
||||
var ret = seriesBuilder.GetSeriesBuilder (HKSeriesType.HeartbeatSeriesType);
|
||||
Assert.IsNull (ret, "GetSeriesBuilder should return a null value without proper configuration.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // HAS_HEALTHKIT
|
|
@ -1,24 +1,9 @@
|
|||
## This key seems broken even in Objc returns a weird value
|
||||
!missing-field! HKSourceRevisionAnyOperatingSystem not bound
|
||||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKCorrelationQuery::get_SamplePredicates()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKObject::get_WeakMetadata()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSPredicate HealthKit.HKQuery::get_Predicate()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSSortDescriptor[] HealthKit.HKSampleQuery::get_SortDescriptors()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBiologicalSexObject HealthKit.HKHealthStore::GetBiologicalSex(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBloodTypeObject HealthKit.HKHealthStore::GetBloodType(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalDistance()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalEnergyBurned()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSeriesBuilder HealthKit.HKWorkoutBuilder::GetSeriesBuilder(HealthKit.HKSeriesType)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSource[] HealthKit.HKStatistics::get_Sources()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKStatistics HealthKit.HKStatisticsCollection::GetStatistics(Foundation.NSDate)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKWorkoutEvent[] HealthKit.HKWorkout::get_WorkoutEvents()' is missing an [NullAllowed] on return type
|
||||
# These ones should have this "extra" null according to the headers and the docs
|
||||
!extra-null-allowed! 'HealthKit.HKCategoryType HealthKit.HKObjectType::GetCategoryType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKCharacteristicType HealthKit.HKObjectType::GetCharacteristicType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKCorrelationType HealthKit.HKObjectType::GetCorrelationType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKDocumentType HealthKit.HKObjectType::_GetDocumentType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKQuantityType HealthKit.HKObjectType::GetQuantityType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
## This key seems broken even in Objc returns a weird value
|
||||
!missing-field! HKSourceRevisionAnyOperatingSystem not bound
|
||||
|
||||
# These ones should have this "extra" null according to the headers and the docs
|
||||
!extra-null-allowed! 'HealthKit.HKCategoryType HealthKit.HKObjectType::GetCategoryType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKCharacteristicType HealthKit.HKObjectType::GetCharacteristicType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKCorrelationType HealthKit.HKObjectType::GetCorrelationType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKDocumentType HealthKit.HKObjectType::_GetDocumentType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
!extra-null-allowed! 'HealthKit.HKQuantityType HealthKit.HKObjectType::GetQuantityType(Foundation.NSString)' has a extraneous [NullAllowed] on parameter #0
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKCorrelationQuery::get_SamplePredicates()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKObject::get_WeakMetadata()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSPredicate HealthKit.HKQuery::get_Predicate()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSSortDescriptor[] HealthKit.HKSampleQuery::get_SortDescriptors()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBiologicalSexObject HealthKit.HKHealthStore::GetBiologicalSex(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBloodTypeObject HealthKit.HKHealthStore::GetBloodType(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalDistance()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalEnergyBurned()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSeriesBuilder HealthKit.HKWorkoutBuilder::GetSeriesBuilder(HealthKit.HKSeriesType)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSource[] HealthKit.HKStatistics::get_Sources()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKStatistics HealthKit.HKStatisticsCollection::GetStatistics(Foundation.NSDate)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKWorkoutEvent[] HealthKit.HKWorkout::get_WorkoutEvents()' is missing an [NullAllowed] on return type
|
|
@ -15,25 +15,3 @@
|
|||
|
||||
## type was marked as available in 3.0 - but it's now iOS 11 only (even if members are marked with 10.0)
|
||||
!unknown-type! HKCDADocument bound
|
||||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKCorrelationQuery::get_SamplePredicates()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSDictionary HealthKit.HKObject::get_WeakMetadata()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSPredicate HealthKit.HKQuery::get_Predicate()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSSortDescriptor[] HealthKit.HKSampleQuery::get_SortDescriptors()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBiologicalSexObject HealthKit.HKHealthStore::GetBiologicalSex(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKBloodTypeObject HealthKit.HKHealthStore::GetBloodType(Foundation.NSError&)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::AverageQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MaximumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::MinimumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKStatistics::SumQuantity(HealthKit.HKSource)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalDistance()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKQuantity HealthKit.HKWorkout::get_TotalEnergyBurned()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSeriesBuilder HealthKit.HKWorkoutBuilder::GetSeriesBuilder(HealthKit.HKSeriesType)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKSource[] HealthKit.HKStatistics::get_Sources()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKStatistics HealthKit.HKStatisticsCollection::GetStatistics(Foundation.NSDate)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'HealthKit.HKWorkoutEvent[] HealthKit.HKWorkout::get_WorkoutEvents()' is missing an [NullAllowed] on return type
|
||||
|
|
Загрузка…
Ссылка в новой задаче