2016-05-26 16:06:52 +03:00
|
|
|
|
//
|
|
|
|
|
// Unit tests for HKCategoryTypeIdentifier
|
|
|
|
|
//
|
|
|
|
|
// Authors:
|
|
|
|
|
// Sebastien Pouliot <sebastien@xamarin.com>
|
|
|
|
|
//
|
|
|
|
|
// Copyright 2014 Xamarin Inc. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
2017-10-31 19:09:21 +03:00
|
|
|
|
#if !__TVOS__ && !MONOMAC
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
#if XAMCORE_2_0
|
|
|
|
|
using Foundation;
|
|
|
|
|
using HealthKit;
|
|
|
|
|
using UIKit;
|
|
|
|
|
#else
|
|
|
|
|
using MonoTouch.Foundation;
|
|
|
|
|
using MonoTouch.HealthKit;
|
|
|
|
|
using MonoTouch.UIKit;
|
|
|
|
|
#endif
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace MonoTouchFixtures.HealthKit {
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
public class CategoryTypeIdentifier {
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void EnumValues_22351 ()
|
|
|
|
|
{
|
2016-05-31 20:13:25 +03:00
|
|
|
|
TestRuntime.AssertXcodeVersion (6, 0);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
foreach (HKCategoryTypeIdentifier value in Enum.GetValues (typeof (HKCategoryTypeIdentifier))) {
|
|
|
|
|
|
|
|
|
|
switch (value) {
|
|
|
|
|
case HKCategoryTypeIdentifier.SleepAnalysis:
|
|
|
|
|
break;
|
2016-08-19 05:59:26 +03:00
|
|
|
|
case HKCategoryTypeIdentifier.MindfulSession:
|
|
|
|
|
if (!TestRuntime.CheckXcodeVersion (8, 0))
|
|
|
|
|
continue;
|
|
|
|
|
break;
|
2016-05-26 16:06:52 +03:00
|
|
|
|
default:
|
2016-05-31 20:13:25 +03:00
|
|
|
|
if (!TestRuntime.CheckXcodeVersion (7, 0))
|
2016-05-26 16:06:52 +03:00
|
|
|
|
continue;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
using (var ct = HKCategoryType.Create (value)) {
|
|
|
|
|
Assert.That (ct.Handle, Is.Not.EqualTo (IntPtr.Zero), value.ToString ());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e) {
|
|
|
|
|
Assert.Fail ("{0} could not be created: {1}", value, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // !__TVOS__
|