[monotouch-tests] Fix HK tests on sonoma. (#19446)
Before this commit we had the following failing test: ``` Error: Exception Message Expected: String matching "Objective-C exception thrown. Name: _HKObjectValidationFailureException Reason: Type HKSample can not have endDate of NSDate.distantFuture" But was: "Objective-C exception thrown. Name: _HKObjectValidationFailureException Reason: startDate (0001-01-01 00:00:00 +0000) and endDate (4001-01-01 00:00:00 +0000) exceed the maximum allowed duration for this sample type. Maximum duration for type ``` The new exception does not happen on macOS but does on iOS.
This commit is contained in:
Родитель
f9ba5467e8
Коммит
9d259a539d
|
@ -57,11 +57,16 @@ namespace MonoTouchFixtures.HealthKit {
|
|||
#else
|
||||
var ex = Assert.Throws<MonoTouchException> (action, "Exception");
|
||||
#endif
|
||||
|
||||
#if MONOMAC
|
||||
Assert.That (ex.Message, Does.Match ("startDate.*and endDate.*exceed the maximum allowed duration for this sample type"), "Exception Message");
|
||||
#else
|
||||
if (TestRuntime.CheckXcodeVersion (15, 0)) {
|
||||
Assert.That (ex.Message, Does.Match ("Objective-C exception thrown. Name: _HKObjectValidationFailureException Reason: Type HKSample can not have endDate of NSDate.distantFuture"), "Exception Message");
|
||||
} else {
|
||||
Assert.That (ex.Message, Does.Match ("startDate.*and endDate.*exceed the maximum allowed duration for this sample type"), "Exception Message");
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
action ();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче