[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)

The PlatformName enum will be removed from .NET soon.
This commit is contained in:
Rolf Bjarne Kvinge 2021-11-15 08:06:36 +01:00 коммит произвёл GitHub
Родитель 7a76bbeb64
Коммит 66e596e9d9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
205 изменённых файлов: 712 добавлений и 493 удалений

Просмотреть файл

@ -53,6 +53,9 @@
<Compile Include="..\common\TestRuntime.cs"> <Compile Include="..\common\TestRuntime.cs">
<Link>TestRuntime.cs</Link> <Link>TestRuntime.cs</Link>
</Compile> </Compile>
<Compile Include="..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Welcome.resx"> <EmbeddedResource Include="Welcome.resx">

Просмотреть файл

@ -19,6 +19,9 @@
<Compile Include="$(RootTestsDirectory)\common\TestRuntime.cs"> <Compile Include="$(RootTestsDirectory)\common\TestRuntime.cs">
<Link>TestRuntime.cs</Link> <Link>TestRuntime.cs</Link>
</Compile> </Compile>
<Compile Include="$(RootTestsDirectory)\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Просмотреть файл

@ -50,6 +50,9 @@
<Compile Include="$(RootTestsDirectory)\common\TestRuntime.cs"> <Compile Include="$(RootTestsDirectory)\common\TestRuntime.cs">
<Link>TestRuntime.cs</Link> <Link>TestRuntime.cs</Link>
</Compile> </Compile>
<Compile Include="$(RootTestsDirectory)\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="$(BindingsTestDirectory)\RuntimeTest.cs" /> <Compile Include="$(BindingsTestDirectory)\RuntimeTest.cs" />
<Compile Include="$(BindingsTestDirectory)\CodeBehind.cs" /> <Compile Include="$(BindingsTestDirectory)\CodeBehind.cs" />
<Compile Include="$(BindingsTestDirectory)\Messaging.cs" /> <Compile Include="$(BindingsTestDirectory)\Messaging.cs" />

Просмотреть файл

@ -81,6 +81,9 @@
<Compile Include="..\..\common\TestRuntime.cs"> <Compile Include="..\..\common\TestRuntime.cs">
<Link>TestRuntime.cs</Link> <Link>TestRuntime.cs</Link>
</Compile> </Compile>
<Compile Include="..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\RuntimeTest.cs" /> <Compile Include="..\RuntimeTest.cs" />
<Compile Include="..\CodeBehind.cs" /> <Compile Include="..\CodeBehind.cs" />
<Compile Include="..\Messaging.cs" /> <Compile Include="..\Messaging.cs" />

Просмотреть файл

@ -68,6 +68,9 @@
<Compile Include="..\..\common\TestRuntime.cs"> <Compile Include="..\..\common\TestRuntime.cs">
<Link>TestRuntime.cs</Link> <Link>TestRuntime.cs</Link>
</Compile> </Compile>
<Compile Include="..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\RuntimeTest.cs" /> <Compile Include="..\RuntimeTest.cs" />
<Compile Include="..\CodeBehind.cs" /> <Compile Include="..\CodeBehind.cs" />
<Compile Include="..\Messaging.cs" /> <Compile Include="..\Messaging.cs" />

Просмотреть файл

@ -31,6 +31,8 @@ using UIKit;
#endif #endif
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
partial class TestRuntime partial class TestRuntime
{ {
@ -744,38 +746,40 @@ partial class TestRuntime
} }
} }
public static bool CheckSystemVersion (PlatformName platform, int major, int minor, int build = 0, bool throwIfOtherPlatform = true) public static bool CheckSystemVersion (ApplePlatform platform, int major, int minor, int build = 0, bool throwIfOtherPlatform = true)
{ {
switch (platform) { switch (platform) {
case PlatformName.iOS: case ApplePlatform.iOS:
return CheckiOSSystemVersion (major, minor, throwIfOtherPlatform); return CheckiOSSystemVersion (major, minor, throwIfOtherPlatform);
case PlatformName.MacOSX: case ApplePlatform.MacOSX:
return CheckMacSystemVersion (major, minor, build, throwIfOtherPlatform); return CheckMacSystemVersion (major, minor, build, throwIfOtherPlatform);
case PlatformName.TvOS: case ApplePlatform.TVOS:
return ChecktvOSSystemVersion (major, minor, throwIfOtherPlatform); return ChecktvOSSystemVersion (major, minor, throwIfOtherPlatform);
case PlatformName.WatchOS: case ApplePlatform.WatchOS:
return CheckWatchOSSystemVersion (major, minor, throwIfOtherPlatform); return CheckWatchOSSystemVersion (major, minor, throwIfOtherPlatform);
case ApplePlatform.MacCatalyst:
return CheckMacCatalystSystemVersion (major, minor, throwIfOtherPlatform);
default: default:
throw new Exception ($"Unknown platform: {platform}"); throw new Exception ($"Unknown platform: {platform}");
} }
} }
public static void AssertSystemVersion (PlatformName platform, int major, int minor, int build = 0, bool throwIfOtherPlatform = true) public static void AssertSystemVersion (ApplePlatform platform, int major, int minor, int build = 0, bool throwIfOtherPlatform = true)
{ {
switch (platform) { switch (platform) {
case PlatformName.iOS: case ApplePlatform.iOS:
AssertiOSSystemVersion (major, minor, throwIfOtherPlatform); AssertiOSSystemVersion (major, minor, throwIfOtherPlatform);
break; break;
case PlatformName.MacOSX: case ApplePlatform.MacOSX:
AssertMacSystemVersion (major, minor, build, throwIfOtherPlatform); AssertMacSystemVersion (major, minor, build, throwIfOtherPlatform);
break; break;
case PlatformName.TvOS: case ApplePlatform.TVOS:
AsserttvOSSystemVersion (major, minor, throwIfOtherPlatform); AsserttvOSSystemVersion (major, minor, throwIfOtherPlatform);
break; break;
case PlatformName.WatchOS: case ApplePlatform.WatchOS:
AssertWatchOSSystemVersion (major, minor, throwIfOtherPlatform); AssertWatchOSSystemVersion (major, minor, throwIfOtherPlatform);
break; break;
case PlatformName.MacCatalyst: case ApplePlatform.MacCatalyst:
AssertMacCatalystSystemVersion (major, minor, build, throwIfOtherPlatform); AssertMacCatalystSystemVersion (major, minor, build, throwIfOtherPlatform);
break; break;
default: default:

Просмотреть файл

@ -34,6 +34,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using Foundation; using Foundation;
using Xamarin.Utils;
namespace Introspection namespace Introspection
{ {
@ -1001,7 +1002,7 @@ namespace Introspection
case Constants.CoreImageLibrary: case Constants.CoreImageLibrary:
break; break;
default: default:
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 11, 0)) { if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 11, 0)) {
// on macOS 11.0 the frameworks binary files are not present (cache) but can be loaded // on macOS 11.0 the frameworks binary files are not present (cache) but can be loaded
if (!Directory.Exists (Path.GetDirectoryName (lib))) if (!Directory.Exists (Path.GetDirectoryName (lib)))
return false; return false;

Просмотреть файл

@ -15,6 +15,7 @@ using Foundation;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Tests; using Xamarin.Tests;
using Xamarin.Utils;
namespace Introspection { namespace Introspection {
@ -142,7 +143,7 @@ namespace Introspection {
// https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc // https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc
return true; return true;
case "Photos.PHProjectChangeRequest": case "Photos.PHProjectChangeRequest":
if (TestRuntime.CheckSystemVersion (ObjCRuntime.PlatformName.MacOSX, 10, 15)) { if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 15)) {
/* /*
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This method can only be called from inside of -[PHPhotoLibrary performChanges:completionHandler:] or -[PHPhotoLibrary performChangesAndWait:error:]' Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This method can only be called from inside of -[PHPhotoLibrary performChanges:completionHandler:] or -[PHPhotoLibrary performChangesAndWait:error:]'
0 CoreFoundation 0x00007fff34f29063 __exceptionPreprocess + 250 0 CoreFoundation 0x00007fff34f29063 __exceptionPreprocess + 250

Просмотреть файл

@ -16,6 +16,7 @@ using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Tests; using Xamarin.Tests;
using Xamarin.Utils;
namespace Introspection { namespace Introspection {
@ -696,7 +697,7 @@ namespace Introspection {
switch (selectorName) { switch (selectorName) {
case "buttonPressed": case "buttonPressed":
// It's just gone! https://github.com/xamarin/maccore/issues/1796 // It's just gone! https://github.com/xamarin/maccore/issues/1796
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 15)) if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 15))
return true; return true;
break; break;
} }
@ -709,7 +710,7 @@ namespace Introspection {
switch (selectorName) { switch (selectorName) {
case "isSyncFailureHidden": case "isSyncFailureHidden":
// It's just gone! https://github.com/xamarin/maccore/issues/1797 // It's just gone! https://github.com/xamarin/maccore/issues/1797
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 15)) if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 15))
return true; return true;
break; break;
} }

Просмотреть файл

@ -15,6 +15,7 @@ using Foundation;
using ObjCRuntime; using ObjCRuntime;
using UIKit; using UIKit;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace Introspection { namespace Introspection {
@ -74,7 +75,7 @@ namespace Introspection {
// 1. is the current SDK target (or a newer one) // 1. is the current SDK target (or a newer one)
var sdk = new Version (Constants.SdkVersion); var sdk = new Version (Constants.SdkVersion);
#if __WATCHOS__ #if __WATCHOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.WatchOS, sdk.Major, sdk.Minor)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.WatchOS, sdk.Major, sdk.Minor))
return true; return true;
#elif __IOS__ || __TVOS__ #elif __IOS__ || __TVOS__
if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor)) if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor))

Просмотреть файл

@ -53,6 +53,7 @@ using OpenGLES;
using WebKit; using WebKit;
using NUnit.Framework; using NUnit.Framework;
using MonoTests.System.Net.Http; using MonoTests.System.Net.Http;
using Xamarin.Utils;
namespace LinkSdk { namespace LinkSdk {
@ -185,7 +186,7 @@ namespace LinkSdk {
// http://bugzilla.xamarin.com/show_bug.cgi?id=980 // http://bugzilla.xamarin.com/show_bug.cgi?id=980
public void Bug980_AddressBook_NRE () public void Bug980_AddressBook_NRE ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); // The AddressBook framework was introduced in Mac Catalyst 14.0 TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false); // The AddressBook framework was introduced in Mac Catalyst 14.0
using (ABPeoplePickerNavigationController picker = new ABPeoplePickerNavigationController ()) { using (ABPeoplePickerNavigationController picker = new ABPeoplePickerNavigationController ()) {
// no NRE should occur // no NRE should occur
if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0))
@ -206,7 +207,7 @@ namespace LinkSdk {
"Please deny access to contacts for this this application (it's important for this test)"); "Please deny access to contacts for this this application (it's important for this test)");
} }
#endif // !__MACOS__ #endif // !__MACOS__
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); // The AddressBook framework was introduced in Mac Catalyst 14.0 TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false); // The AddressBook framework was introduced in Mac Catalyst 14.0
Assert.IsNotNull (ABPersonAddressKey.City, "ABPersonAddressKey"); Assert.IsNotNull (ABPersonAddressKey.City, "ABPersonAddressKey");
} }
#endif // HAS_ADDRESSBOOKUI #endif // HAS_ADDRESSBOOKUI
@ -928,7 +929,7 @@ namespace LinkSdk {
#endif #endif
#if __MACOS__ #if __MACOS__
var isMac1015 = TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 15); var isMac1015 = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 15);
path = TestFolder (Environment.SpecialFolder.Favorites, supported: isMac1015, exists: isMac1015); path = TestFolder (Environment.SpecialFolder.Favorites, supported: isMac1015, exists: isMac1015);
#elif __MACCATALYST__ #elif __MACCATALYST__
path = TestFolder (Environment.SpecialFolder.Favorites, exists: true); path = TestFolder (Environment.SpecialFolder.Favorites, exists: true);

Просмотреть файл

@ -67,6 +67,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Stub.cs" /> <Compile Include="Stub.cs" />
<Compile Include="..\..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\..\..\common\mac\MacMain.cs"> <Compile Include="..\..\..\common\mac\MacMain.cs">
<Link>MacMain.cs</Link> <Link>MacMain.cs</Link>
</Compile> </Compile>

Просмотреть файл

@ -79,6 +79,9 @@
</Compile> </Compile>
<Compile Include="..\..\BaseOptimizeGeneratedCodeTest.cs" /> <Compile Include="..\..\BaseOptimizeGeneratedCodeTest.cs" />
<Compile Include="LinkAllTest.cs" /> <Compile Include="LinkAllTest.cs" />
<Compile Include="..\..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\..\..\common\PlatformInfo.cs"> <Compile Include="..\..\..\common\PlatformInfo.cs">
<Link>PlatformInfo.cs</Link> <Link>PlatformInfo.cs</Link>
</Compile> </Compile>

Просмотреть файл

@ -73,6 +73,9 @@
<Link>Mac.cs</Link> <Link>Mac.cs</Link>
</Compile> </Compile>
<Compile Include="LinkSdkTest.cs" /> <Compile Include="LinkSdkTest.cs" />
<Compile Include="..\..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\..\..\common\PlatformInfo.cs"> <Compile Include="..\..\..\common\PlatformInfo.cs">
<Link>PlatformInfo.cs</Link> <Link>PlatformInfo.cs</Link>
</Compile> </Compile>

Просмотреть файл

@ -14,6 +14,7 @@ using ARKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using MatrixFloat4x4 = global::OpenTK.NMatrix4; using MatrixFloat4x4 = global::OpenTK.NMatrix4;
@ -28,7 +29,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (10, 0); TestRuntime.AssertXcodeVersion (10, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -6,6 +6,7 @@ using ARKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.ARKit { namespace MonoTouchFixtures.ARKit {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (9, 3); TestRuntime.AssertXcodeVersion (9, 3);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -14,6 +14,7 @@ using ARKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using VectorFloat3 = global::OpenTK.NVector3; using VectorFloat3 = global::OpenTK.NVector3;
using MatrixFloat4x4 = global::OpenTK.NMatrix4; using MatrixFloat4x4 = global::OpenTK.NMatrix4;
@ -29,7 +30,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (10, 0); TestRuntime.AssertXcodeVersion (10, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -16,6 +16,7 @@ using ARKit;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
using VectorFloat2 = global::OpenTK.Vector2; using VectorFloat2 = global::OpenTK.Vector2;
using VectorFloat3 = global::OpenTK.NVector3; using VectorFloat3 = global::OpenTK.NVector3;
@ -89,7 +90,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (9, 0); TestRuntime.AssertXcodeVersion (9, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -16,6 +16,7 @@ using ARKit;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
using VectorFloat2 = global::OpenTK.Vector2; using VectorFloat2 = global::OpenTK.Vector2;
using VectorFloat3 = global::OpenTK.NVector3; using VectorFloat3 = global::OpenTK.NVector3;
@ -103,7 +104,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (9, 0); TestRuntime.AssertXcodeVersion (9, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -17,6 +17,7 @@ using AVFoundation;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
using MatrixFloat2x2 = global::OpenTK.NMatrix2; using MatrixFloat2x2 = global::OpenTK.NMatrix2;
using MatrixFloat3x3 = global::OpenTK.NMatrix3; using MatrixFloat3x3 = global::OpenTK.NMatrix3;
@ -78,7 +79,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (9, 0); TestRuntime.AssertXcodeVersion (9, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -14,6 +14,7 @@ using ARKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using VectorFloat3 = global::OpenTK.NVector3; using VectorFloat3 = global::OpenTK.NVector3;
using MatrixFloat4x4 = global::OpenTK.NMatrix4; using MatrixFloat4x4 = global::OpenTK.NMatrix4;
@ -29,7 +30,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (10, 0); TestRuntime.AssertXcodeVersion (10, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -16,6 +16,7 @@ using ARKit;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
using Vector2 = global::OpenTK.Vector2; using Vector2 = global::OpenTK.Vector2;
@ -63,7 +64,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (11, 0); TestRuntime.AssertXcodeVersion (11, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -16,6 +16,7 @@ using ARKit;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
using Matrix4 = global::OpenTK.NMatrix4; using Matrix4 = global::OpenTK.NMatrix4;
@ -77,7 +78,7 @@ namespace MonoTouchFixtures.ARKit {
{ {
TestRuntime.AssertXcodeVersion (11, 0); TestRuntime.AssertXcodeVersion (11, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -7,6 +7,7 @@ using ARKit;
using Foundation; using Foundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace monotouchtest.ARKit { namespace monotouchtest.ARKit {
[TestFixture] [TestFixture]
@ -18,7 +19,7 @@ namespace monotouchtest.ARKit {
{ {
TestRuntime.AssertXcodeVersion (12, 0); TestRuntime.AssertXcodeVersion (12, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -18,6 +18,7 @@ using AVFoundation;
using CoreMedia; using CoreMedia;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -95,7 +96,7 @@ namespace MonoTouchFixtures.AVFoundation {
{ {
// This test deadlocks on Mountain Lion (but works on Lion) // This test deadlocks on Mountain Lion (but works on Lion)
// https://gist.github.com/rolfbjarne/1190d97af79e554c298f2c133dfd8e87 // https://gist.github.com/rolfbjarne/1190d97af79e554c298f2c133dfd8e87
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
handled = false; handled = false;
mre = new ManualResetEvent (false); mre = new ManualResetEvent (false);

Просмотреть файл

@ -7,6 +7,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -17,8 +18,8 @@ namespace MonoTouchFixtures.AVFoundation {
[SetUp] [SetUp]
public void Setup () public void Setup ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -4,6 +4,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -14,7 +15,7 @@ namespace MonoTouchFixtures.AVFoundation {
[SetUp] [SetUp]
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12,0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12,0);
} }
[TestCase] [TestCase]

Просмотреть файл

@ -4,6 +4,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -14,7 +15,7 @@ namespace MonoTouchFixtures.AVFoundation {
[SetUp] [SetUp]
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12,0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12,0);
} }
[TestCase] [TestCase]

Просмотреть файл

@ -4,6 +4,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using NUnit.Framework; using NUnit.Framework;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -14,7 +15,7 @@ namespace MonoTouchFixtures.AVFoundation {
[SetUp] [SetUp]
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12,0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12,0);
} }
[Test] [Test]

Просмотреть файл

@ -3,6 +3,8 @@ using Foundation;
using AVFoundation; using AVFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
[TestFixture] [TestFixture]
@ -32,12 +34,12 @@ namespace MonoTouchFixtures.AVFoundation {
Compare (AVMediaType.Timecode, AVMediaTypes.Timecode); Compare (AVMediaType.Timecode, AVMediaTypes.Timecode);
Compare (AVMediaType.Video, AVMediaTypes.Video); Compare (AVMediaType.Video, AVMediaTypes.Video);
if (TestRuntime.CheckSystemVersion (PlatformName.iOS, 9,0)) if (TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 9,0))
Compare (AVMediaType.MetadataObject, AVMediaTypes.MetadataObject); Compare (AVMediaType.MetadataObject, AVMediaTypes.MetadataObject);
// obsoleted in iOS 6, removed in iOS12 // obsoleted in iOS 6, removed in iOS12
#if !__MACCATALYST__ #if !__MACCATALYST__
if (TestRuntime.CheckSystemVersion (PlatformName.iOS, 12, 0)) if (TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 12, 0))
Assert.Null (AVMediaType.TimedMetadata, "AVMediaTypeTimedMetadata"); Assert.Null (AVMediaType.TimedMetadata, "AVMediaTypeTimedMetadata");
else else
Compare (AVMediaType.TimedMetadata, AVMediaTypes.TimedMetadata); Compare (AVMediaType.TimedMetadata, AVMediaTypes.TimedMetadata);

Просмотреть файл

@ -16,6 +16,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -34,7 +35,7 @@ namespace MonoTouchFixtures.AVFoundation {
Assert.AreEqual (0, obj.WeakAvailableMetadataObjectTypes.Length, "WeakAvailableMetadataObjectTypes#"); Assert.AreEqual (0, obj.WeakAvailableMetadataObjectTypes.Length, "WeakAvailableMetadataObjectTypes#");
Assert.IsNotNull (obj.WeakMetadataObjectTypes, "WeakMetadataObjectTypes"); Assert.IsNotNull (obj.WeakMetadataObjectTypes, "WeakMetadataObjectTypes");
Assert.AreEqual (0, obj.WeakMetadataObjectTypes.Length, "WeakMetadataObjectTypes#"); Assert.AreEqual (0, obj.WeakMetadataObjectTypes.Length, "WeakMetadataObjectTypes#");
if (TestRuntime.CheckSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false)) if (TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false))
Assert.AreEqual (new CGRect (0, 0, 1, 1), obj.RectOfInterest, "RectOfInterest"); Assert.AreEqual (new CGRect (0, 0, 1, 1), obj.RectOfInterest, "RectOfInterest");
#if !__MACCATALYST__ // https://github.com/xamarin/maccore/issues/2345 #if !__MACCATALYST__ // https://github.com/xamarin/maccore/issues/2345
@ -90,7 +91,7 @@ namespace MonoTouchFixtures.AVFoundation {
[Test] [Test]
public void MetadataObjectTypesTest () public void MetadataObjectTypesTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
if (Runtime.Arch != Arch.DEVICE) if (Runtime.Arch != Arch.DEVICE)
Assert.Ignore ("This test only runs on device (requires camera access)"); Assert.Ignore ("This test only runs on device (requires camera access)");

Просмотреть файл

@ -14,6 +14,7 @@ using Foundation;
using AVFoundation; using AVFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -25,7 +26,7 @@ namespace MonoTouchFixtures.AVFoundation {
public void Defaults () public void Defaults ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var obj = new AVMetadataFaceObject ()) { using (var obj = new AVMetadataFaceObject ()) {
Assert.AreEqual ((nint) 0, obj.FaceID, "FaceID"); Assert.AreEqual ((nint) 0, obj.FaceID, "FaceID");

Просмотреть файл

@ -15,6 +15,7 @@ using CoreVideo;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -25,7 +26,7 @@ namespace MonoTouchFixtures.AVFoundation {
[Test] [Test]
public void Ctor_CVPixelBufferAttributes () public void Ctor_CVPixelBufferAttributes ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
var attributes = new CVPixelBufferAttributes () { var attributes = new CVPixelBufferAttributes () {
PixelFormatType = CVPixelFormatType.CV32BGRA PixelFormatType = CVPixelFormatType.CV32BGRA

Просмотреть файл

@ -17,6 +17,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVFoundation { namespace MonoTouchFixtures.AVFoundation {
@ -29,10 +30,10 @@ namespace MonoTouchFixtures.AVFoundation {
public void SetUp () public void SetUp ()
{ {
#if __WATCHOS__ #if __WATCHOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.WatchOS, 3, 0)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.WatchOS, 3, 0))
Assert.Inconclusive ("Requires watchOS 3.0+"); Assert.Inconclusive ("Requires watchOS 3.0+");
#else #else
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
#endif #endif
} }

Просмотреть файл

@ -16,6 +16,7 @@ using UIKit;
using iAd; using iAd;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AVKit { namespace MonoTouchFixtures.AVKit {
@ -26,7 +27,7 @@ namespace MonoTouchFixtures.AVKit {
[Test] [Test]
public void PreparePrerollAds_New () public void PreparePrerollAds_New ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
AVPlayerViewController.PrepareForPrerollAds (); AVPlayerViewController.PrepareForPrerollAds ();
} }

Просмотреть файл

@ -15,6 +15,7 @@ using UIKit;
using AddressBook; using AddressBook;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AddressBook { namespace MonoTouchFixtures.AddressBook {
@ -28,7 +29,7 @@ namespace MonoTouchFixtures.AddressBook {
public void Setup () public void Setup ()
{ {
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]
@ -37,7 +38,7 @@ namespace MonoTouchFixtures.AddressBook {
TestRuntime.CheckAddressBookPermission (); TestRuntime.CheckAddressBookPermission ();
ABAddressBook ab = new ABAddressBook (); ABAddressBook ab = new ABAddressBook ();
var sources = ab.GetAllSources (); var sources = ab.GetAllSources ();
int value = Runtime.Arch == Arch.DEVICE || TestRuntime.CheckSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false) ? 0 : 1; int value = Runtime.Arch == Arch.DEVICE || TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false) ? 0 : 1;
Assert.That (sources.Length, Is.GreaterThanOrEqualTo (value), "GetAllSources"); Assert.That (sources.Length, Is.GreaterThanOrEqualTo (value), "GetAllSources");
} }

Просмотреть файл

@ -15,6 +15,7 @@ using UIKit;
using AddressBook; using AddressBook;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AddressBook { namespace MonoTouchFixtures.AddressBook {
@ -26,7 +27,7 @@ namespace MonoTouchFixtures.AddressBook {
public void Setup () public void Setup ()
{ {
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -15,6 +15,7 @@ using UIKit;
using AddressBook; using AddressBook;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AddressBook { namespace MonoTouchFixtures.AddressBook {
@ -26,7 +27,7 @@ namespace MonoTouchFixtures.AddressBook {
public void Setup () public void Setup ()
{ {
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -16,6 +16,7 @@ using AddressBookUI;
using ObjCRuntime; using ObjCRuntime;
using UIKit; using UIKit;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AddressBookUI { namespace MonoTouchFixtures.AddressBookUI {
@ -27,7 +28,7 @@ namespace MonoTouchFixtures.AddressBookUI {
public void Setup () public void Setup ()
{ {
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]
@ -66,7 +67,7 @@ namespace MonoTouchFixtures.AddressBookUI {
// iOS 8.2 beta 5 (12D5480a) simulator (Xcode 6.2 beta 5): working // iOS 8.2 beta 5 (12D5480a) simulator (Xcode 6.2 beta 5): working
// we don't check before 8.2 - where both device and simulators works again properly // we don't check before 8.2 - where both device and simulators works again properly
if (!TestRuntime.CheckSystemVersion (PlatformName.iOS, 8, 2)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 8, 2))
return; return;
// iOS 11.0 beta 1, 2, 3 and 4 are broken // iOS 11.0 beta 1, 2, 3 and 4 are broken

Просмотреть файл

@ -5,6 +5,7 @@ using NUnit.Framework;
using AppKit; using AppKit;
using ObjCRuntime; using ObjCRuntime;
using Foundation; using Foundation;
using Xamarin.Utils;
namespace Xamarin.Mac.Tests namespace Xamarin.Mac.Tests
{ {
@ -14,8 +15,7 @@ namespace Xamarin.Mac.Tests
[Test] [Test]
public void NSSearchFieldShouldSetSearchMenuTemplate () public void NSSearchFieldShouldSetSearchMenuTemplate ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_10) TestRuntime.AssertXcodeVersion (6, 1);
return;
var searchField = new NSSearchField (); var searchField = new NSSearchField ();
var searchMenuTemplate = searchField.SearchMenuTemplate; var searchMenuTemplate = searchField.SearchMenuTemplate;
@ -27,8 +27,7 @@ namespace Xamarin.Mac.Tests
[Test] [Test]
public void NSSearchFieldShouldSetSendsWholeSearchString () public void NSSearchFieldShouldSetSendsWholeSearchString ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_10) TestRuntime.AssertXcodeVersion (6, 1);
return;
var searchField = new NSSearchField (); var searchField = new NSSearchField ();
var sendsWholeSearchString = searchField.SendsWholeSearchString; var sendsWholeSearchString = searchField.SendsWholeSearchString;
@ -40,8 +39,7 @@ namespace Xamarin.Mac.Tests
[Test] [Test]
public void NSSearchFieldShouldSetMaximumRecents () public void NSSearchFieldShouldSetMaximumRecents ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_10) TestRuntime.AssertXcodeVersion (6, 1);
return;
var searchField = new NSSearchField (); var searchField = new NSSearchField ();
var maximumRecents = searchField.MaximumRecents; var maximumRecents = searchField.MaximumRecents;
@ -53,8 +51,7 @@ namespace Xamarin.Mac.Tests
[Test] [Test]
public void NSSearchFieldShouldSetSendsSearchStringImmediately () public void NSSearchFieldShouldSetSendsSearchStringImmediately ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_10) TestRuntime.AssertXcodeVersion (6, 1);
return;
var searchField = new NSSearchField (); var searchField = new NSSearchField ();
var sendsSearchStringImmediately = searchField.SendsSearchStringImmediately; var sendsSearchStringImmediately = searchField.SendsSearchStringImmediately;

Просмотреть файл

@ -5,6 +5,7 @@ using System;
using AppKit; using AppKit;
using ObjCRuntime; using ObjCRuntime;
using Foundation; using Foundation;
using Xamarin.Utils;
namespace Xamarin.Mac.Tests namespace Xamarin.Mac.Tests
{ {
@ -15,8 +16,7 @@ namespace Xamarin.Mac.Tests
[Test] [Test]
public void NSSlider_VertialTests() public void NSSlider_VertialTests()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_12) TestRuntime.AssertXcodeVersion (8, 0);
return;
NSSlider slider = new NSSlider (); NSSlider slider = new NSSlider ();
var isVert = slider.IsVertical; var isVert = slider.IsVertical;

Просмотреть файл

@ -6,6 +6,7 @@ using System.Linq;
using AppKit; using AppKit;
using ObjCRuntime; using ObjCRuntime;
using Foundation; using Foundation;
using Xamarin.Utils;
namespace Xamarin.Mac.Tests namespace Xamarin.Mac.Tests
{ {
@ -44,7 +45,7 @@ namespace Xamarin.Mac.Tests
public void NSTabViewControllerShouldChangeSegmentedControl () public void NSTabViewControllerShouldChangeSegmentedControl ()
{ {
// This API was removed in 10.11 // This API was removed in 10.11
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) >= Platform.Mac_10_11) if (TestRuntime.CheckXcodeVersion (7, 0))
return; return;
var segmentedControl = controller.SegmentedControl; var segmentedControl = controller.SegmentedControl;

Просмотреть файл

@ -4,6 +4,7 @@ using System.Reflection;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Tests; using Xamarin.Tests;
using Xamarin.Utils;
using ObjCRuntime; using ObjCRuntime;
using Foundation; using Foundation;
@ -14,13 +15,13 @@ namespace Xamarin.Mac.Tests
{ {
public static bool IsAtLeastYosemite { public static bool IsAtLeastYosemite {
get { get {
return PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) >= Platform.Mac_10_10; return TestRuntime.CheckXcodeVersion (6, 1);
} }
} }
public static bool IsAtLeastElCapitan { public static bool IsAtLeastElCapitan {
get { get {
return PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) >= Platform.Mac_10_11; return TestRuntime.CheckXcodeVersion (7, 0);
} }
} }
@ -32,14 +33,12 @@ namespace Xamarin.Mac.Tests
public static void EnsureMavericks () public static void EnsureMavericks ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_9) TestRuntime.AssertXcodeVersion (6, 0);
Assert.Pass ("This test requires Mavericks. Skipping");
} }
public static void EnsureMountainLion () public static void EnsureMountainLion ()
{ {
if (PlatformHelper.ToMacVersion (PlatformHelper.GetHostApiPlatform ()) < Platform.Mac_10_8) // We're always running on at least Mountain Lion
Assert.Pass ("This test requires Mountain Lion. Skipping");
} }
public static void Ensure64Bit () public static void Ensure64Bit ()

Просмотреть файл

@ -14,6 +14,7 @@ using Foundation;
using AudioToolbox; using AudioToolbox;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AudioToolbox { namespace MonoTouchFixtures.AudioToolbox {
@ -26,7 +27,7 @@ namespace MonoTouchFixtures.AudioToolbox {
[Test] [Test]
public void GetName () public void GetName ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
Assert.Throws<ArgumentNullException> (delegate { SoundBank.GetName (null); }, "null"); Assert.Throws<ArgumentNullException> (delegate { SoundBank.GetName (null); }, "null");
@ -39,7 +40,7 @@ namespace MonoTouchFixtures.AudioToolbox {
[Test] [Test]
public void GetName_DLS_SimOnly () public void GetName_DLS_SimOnly ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
if (Runtime.Arch == Arch.DEVICE) if (Runtime.Arch == Arch.DEVICE)
Assert.Ignore ("Use local file system (need a smaller sample)"); Assert.Ignore ("Use local file system (need a smaller sample)");
@ -52,8 +53,8 @@ namespace MonoTouchFixtures.AudioToolbox {
[Test] [Test]
public void GetInstrumentInfo () public void GetInstrumentInfo ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
Assert.Throws<ArgumentNullException> (delegate { SoundBank.GetInstrumentInfo (null); }, "null"); Assert.Throws<ArgumentNullException> (delegate { SoundBank.GetInstrumentInfo (null); }, "null");
@ -66,7 +67,7 @@ namespace MonoTouchFixtures.AudioToolbox {
[Test] [Test]
public void GetInstrumentInfo_DLS_SimOnly () public void GetInstrumentInfo_DLS_SimOnly ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
if (Runtime.Arch == Arch.DEVICE) if (Runtime.Arch == Arch.DEVICE)
Assert.Ignore ("Use local file system (need a smaller sample)"); Assert.Ignore ("Use local file system (need a smaller sample)");

Просмотреть файл

@ -15,6 +15,7 @@ using Foundation;
using AudioToolbox; using AudioToolbox;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.AudioToolbox { namespace MonoTouchFixtures.AudioToolbox {
@ -57,7 +58,7 @@ namespace MonoTouchFixtures.AudioToolbox {
public void TestCallbackPlaySystem () public void TestCallbackPlaySystem ()
{ {
TestRuntime.AssertNotSimulator (); TestRuntime.AssertNotSimulator ();
TestRuntime.AssertSystemVersion (PlatformName.iOS, 9, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 9, 0, throwIfOtherPlatform: false);
string path = Path.Combine (NSBundle.MainBundle.ResourcePath, "drum01.mp3"); string path = Path.Combine (NSBundle.MainBundle.ResourcePath, "drum01.mp3");
@ -77,7 +78,7 @@ namespace MonoTouchFixtures.AudioToolbox {
public void TestCallbackPlayAlert () public void TestCallbackPlayAlert ()
{ {
TestRuntime.AssertNotSimulator (); TestRuntime.AssertNotSimulator ();
TestRuntime.AssertSystemVersion (PlatformName.iOS, 9, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 9, 0, throwIfOtherPlatform: false);
string path = Path.Combine (NSBundle.MainBundle.ResourcePath, "drum01.mp3"); string path = Path.Combine (NSBundle.MainBundle.ResourcePath, "drum01.mp3");

Просмотреть файл

@ -14,6 +14,7 @@ using NUnit.Framework;
using CarPlay; using CarPlay;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CarPlay { namespace MonoTouchFixtures.CarPlay {
@ -26,7 +27,7 @@ namespace MonoTouchFixtures.CarPlay {
{ {
TestRuntime.AssertXcodeVersion (12, 0); TestRuntime.AssertXcodeVersion (12, 0);
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKFetchNotificationChangesOperation (token); op = new CKFetchNotificationChangesOperation (token);
} }

Просмотреть файл

@ -4,6 +4,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -19,7 +20,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
zoneID = new CKRecordZoneID ("foo", "xamarin"); zoneID = new CKRecordZoneID ("foo", "xamarin");
op = new CKFetchRecordChangesOperation (zoneID, null); op = new CKFetchRecordChangesOperation (zoneID, null);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKFetchRecordZonesOperation (zoneIDs); op = new CKFetchRecordZonesOperation (zoneIDs);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKFetchRecordsOperation (recordIDs); op = new CKFetchRecordsOperation (recordIDs);
} }

Просмотреть файл

@ -4,6 +4,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -19,7 +20,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKFetchSubscriptionsOperation (ids); op = new CKFetchSubscriptionsOperation (ids);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKMarkNotificationsReadOperation (notificationIDs); op = new CKMarkNotificationsReadOperation (notificationIDs);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -17,7 +18,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKModifyBadgeOperation (3); op = new CKModifyBadgeOperation (3);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -17,7 +18,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKModifyRecordZonesOperation (null, null); op = new CKModifyRecordZonesOperation (null, null);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -17,7 +18,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKModifyRecordsOperation (null, null); op = new CKModifyRecordsOperation (null, null);
} }

Просмотреть файл

@ -4,6 +4,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
op = new CKModifySubscriptionsOperation (null, null); op = new CKModifySubscriptionsOperation (null, null);
} }

Просмотреть файл

@ -3,6 +3,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using CloudKit; using CloudKit;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.CloudKit namespace MonoTouchFixtures.CloudKit
{ {
@ -18,7 +19,7 @@ namespace MonoTouchFixtures.CloudKit
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
q = new CKQuery ("Foo", NSPredicate.FromFormat ("email = '@xamarin'")); q = new CKQuery ("Foo", NSPredicate.FromFormat ("email = '@xamarin'"));
op = new CKQueryOperation (q); op = new CKQueryOperation (q);
} }

Просмотреть файл

@ -13,6 +13,7 @@ using Foundation;
using CoreAnimation; using CoreAnimation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreAnimation { namespace MonoTouchFixtures.CoreAnimation {
@ -26,8 +27,8 @@ namespace MonoTouchFixtures.CoreAnimation {
[Test] [Test]
public void AllBehaviorTypes () public void AllBehaviorTypes ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
// turns out there's 2 undocumented behaviors: colorOverDistance and valueOverDistance // turns out there's 2 undocumented behaviors: colorOverDistance and valueOverDistance
foreach (var type in CAEmitterBehavior.BehaviorTypes) { foreach (var type in CAEmitterBehavior.BehaviorTypes) {
@ -42,8 +43,8 @@ namespace MonoTouchFixtures.CoreAnimation {
[Test] [Test]
public void ColorOverDistance () public void ColorOverDistance ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
// undocumented - we'll track it over the betas :) // undocumented - we'll track it over the betas :)
using (var eb = CAEmitterBehavior.Create ((NSString) "colorOverDistance")) { using (var eb = CAEmitterBehavior.Create ((NSString) "colorOverDistance")) {
@ -62,8 +63,8 @@ namespace MonoTouchFixtures.CoreAnimation {
[Test] [Test]
public void ValueOverDistance () public void ValueOverDistance ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
// undocumented - we'll track it over the betas :) // undocumented - we'll track it over the betas :)
using (var eb = CAEmitterBehavior.Create ((NSString) "valueOverDistance")) { using (var eb = CAEmitterBehavior.Create ((NSString) "valueOverDistance")) {

Просмотреть файл

@ -19,6 +19,7 @@ using ObjCRuntime;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreBluetooth { namespace MonoTouchFixtures.CoreBluetooth {
@ -81,7 +82,7 @@ namespace MonoTouchFixtures.CoreBluetooth {
//known UUID for a heart monitor, more common, we want to find something and make sure we do not crash //known UUID for a heart monitor, more common, we want to find something and make sure we do not crash
heartRateMonitorUUID = CBUUID.FromPartial (0x180D); heartRateMonitorUUID = CBUUID.FromPartial (0x180D);
// Required API is available in macOS 10.8, but it doesn't work (hangs in 10.8-10.9, randomly crashes in 10.10) on the bots. // Required API is available in macOS 10.8, but it doesn't work (hangs in 10.8-10.9, randomly crashes in 10.10) on the bots.
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
mgrDelegate = new ManagerDelegate (); mgrDelegate = new ManagerDelegate ();
mgr = new CBCentralManager (mgrDelegate, new DispatchQueue ("com.xamarin.tests." + TestContext.CurrentContext.Test.Name)); mgr = new CBCentralManager (mgrDelegate, new DispatchQueue ("com.xamarin.tests." + TestContext.CurrentContext.Test.Name));
if (!mgrDelegate.PoweredOnEvent.WaitOne (TimeSpan.FromSeconds (5))) if (!mgrDelegate.PoweredOnEvent.WaitOne (TimeSpan.FromSeconds (5)))

Просмотреть файл

@ -13,6 +13,7 @@ using Foundation;
using CoreBluetooth; using CoreBluetooth;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreBluetooth { namespace MonoTouchFixtures.CoreBluetooth {
@ -22,8 +23,8 @@ namespace MonoTouchFixtures.CoreBluetooth {
[Test] [Test]
public void Constructor () public void Constructor ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 13, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 13, throwIfOtherPlatform: false);
// crash at dispose time in beta 4 (and 5) // crash at dispose time in beta 4 (and 5)
// the type is undocumented but I think it's should be abstract (not user creatable) // the type is undocumented but I think it's should be abstract (not user creatable)

Просмотреть файл

@ -21,6 +21,7 @@ using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreBluetooth { namespace MonoTouchFixtures.CoreBluetooth {
@ -124,7 +125,7 @@ namespace MonoTouchFixtures.CoreBluetooth {
Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3"); Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3");
} }
#if MONOMAC #if MONOMAC
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) { if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
guid = new byte [] { 0xaa, 0xbb, 0xcc, 0xdd }; guid = new byte [] { 0xaa, 0xbb, 0xcc, 0xdd };
Assert.That (CBUUID.FromBytes (guid), Assert.That (CBUUID.FromBytes (guid),
Is.EqualTo (CBUUID.FromBytes (guid))); Is.EqualTo (CBUUID.FromBytes (guid)));
@ -162,7 +163,7 @@ namespace MonoTouchFixtures.CoreBluetooth {
Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3"); Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3");
} }
#if MONOMAC #if MONOMAC
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) { if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
Assert.That (CBUUID.FromBytes (new byte [] { 0xab, 0xcd, 0xef, 0x12 }), Assert.That (CBUUID.FromBytes (new byte [] { 0xab, 0xcd, 0xef, 0x12 }),
Is.EqualTo (MakeFull (0xab, 0xcd, 0xef, 0x12))); Is.EqualTo (MakeFull (0xab, 0xcd, 0xef, 0x12)));
@ -175,7 +176,7 @@ namespace MonoTouchFixtures.CoreBluetooth {
[Test] [Test]
public void Equality_PartialsOfDifferentSizeNotEqual () public void Equality_PartialsOfDifferentSizeNotEqual ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
#if MONOMAC #if MONOMAC
Assert.That (CBUUID.FromPartial (0x1234), Is.Not.EqualTo ( Assert.That (CBUUID.FromPartial (0x1234), Is.Not.EqualTo (
CBUUID.FromBytes (new byte [] { 0x12, 0x34, 0x56, 0x78 }))); CBUUID.FromBytes (new byte [] { 0x12, 0x34, 0x56, 0x78 })));

Просмотреть файл

@ -12,6 +12,7 @@ using Foundation;
using CoreData; using CoreData;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreData { namespace MonoTouchFixtures.CoreData {
@ -30,7 +31,7 @@ namespace MonoTouchFixtures.CoreData {
Assert.That (moc.RegisteredObjects.Count, Is.EqualTo ((nuint) 0), "RegisteredObjects"); Assert.That (moc.RegisteredObjects.Count, Is.EqualTo ((nuint) 0), "RegisteredObjects");
Assert.False (moc.RetainsRegisteredObjects, "RetainsRegisteredObjects"); Assert.False (moc.RetainsRegisteredObjects, "RetainsRegisteredObjects");
Assert.That (moc.StalenessInterval, Is.EqualTo (-1), "StalenessInterval"); Assert.That (moc.StalenessInterval, Is.EqualTo (-1), "StalenessInterval");
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 12, throwIfOtherPlatform: false)) if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12, throwIfOtherPlatform: false))
Assert.Null (moc.UndoManager, "UndoManager"); Assert.Null (moc.UndoManager, "UndoManager");
else else
Assert.NotNull (moc.UndoManager, "UndoManager"); Assert.NotNull (moc.UndoManager, "UndoManager");

Просмотреть файл

@ -13,6 +13,7 @@ using Foundation;
using CoreFoundation; using CoreFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreFoundation namespace MonoTouchFixtures.CoreFoundation
{ {
@ -24,8 +25,8 @@ namespace MonoTouchFixtures.CoreFoundation
[SetUp] [SetUp]
public void SetUp () public void SetUp ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -13,6 +13,7 @@ using Foundation;
using CoreFoundation; using CoreFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreFoundation { namespace MonoTouchFixtures.CoreFoundation {
@ -49,8 +50,8 @@ namespace MonoTouchFixtures.CoreFoundation {
[Test] [Test]
public void NotifyWithDispatchBlock () public void NotifyWithDispatchBlock ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var dg = new DispatchGroup ()) { using (var dg = new DispatchGroup ()) {
var called = false; var called = false;

Просмотреть файл

@ -18,6 +18,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreFoundation namespace MonoTouchFixtures.CoreFoundation
{ {
@ -86,8 +87,8 @@ namespace MonoTouchFixtures.CoreFoundation
[Test] [Test]
public void DispatchSync () public void DispatchSync ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var queue = new DispatchQueue ("DispatchSync")) { using (var queue = new DispatchQueue ("DispatchSync")) {
var called = false; var called = false;
@ -105,8 +106,8 @@ namespace MonoTouchFixtures.CoreFoundation
[Test] [Test]
public void DispatchBarrierSync () public void DispatchBarrierSync ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var queue = new DispatchQueue ("DispatchBarrierSync")) { using (var queue = new DispatchQueue ("DispatchBarrierSync")) {
var called = false; var called = false;
@ -124,8 +125,8 @@ namespace MonoTouchFixtures.CoreFoundation
[Test] [Test]
public void DispatchAsync () public void DispatchAsync ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var queue = new DispatchQueue ("DispatchAsync")) { using (var queue = new DispatchQueue ("DispatchAsync")) {
var called = false; var called = false;
@ -146,8 +147,8 @@ namespace MonoTouchFixtures.CoreFoundation
[Test] [Test]
public void DispatchBarrierAsync () public void DispatchBarrierAsync ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var queue = new DispatchQueue ("DispatchBarrierAsync")) { using (var queue = new DispatchQueue ("DispatchBarrierAsync")) {
var called = false; var called = false;

Просмотреть файл

@ -20,6 +20,7 @@ using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using System.Threading; using System.Threading;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreFoundation { namespace MonoTouchFixtures.CoreFoundation {
@ -166,12 +167,12 @@ namespace MonoTouchFixtures.CoreFoundation {
{ {
var qname = "com.apple.root.default-priority"; var qname = "com.apple.root.default-priority";
#if __IOS__ #if __IOS__
if (TestRuntime.CheckSystemVersion (PlatformName.iOS, 8, 0)) if (TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 8, 0))
qname = "com.apple.root.default-qos"; qname = "com.apple.root.default-qos";
#elif __WATCHOS__ || __TVOS__ #elif __WATCHOS__ || __TVOS__
qname = "com.apple.root.default-qos"; qname = "com.apple.root.default-qos";
#elif __MACOS__ #elif __MACOS__
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10))
qname = "com.apple.root.default-qos"; qname = "com.apple.root.default-qos";
#endif #endif
Assert.That (DispatchQueue.DefaultGlobalQueue.Label, Is.EqualTo (qname), "Default"); Assert.That (DispatchQueue.DefaultGlobalQueue.Label, Is.EqualTo (qname), "Default");
@ -231,7 +232,7 @@ namespace MonoTouchFixtures.CoreFoundation {
[Test] [Test]
public void GetGlobalQueue_QualityOfService () public void GetGlobalQueue_QualityOfService ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
// values changes in OS versions (and even in arch) but we only want to make sure we get a valid string so the prefix is enough // values changes in OS versions (and even in arch) but we only want to make sure we get a valid string so the prefix is enough
Assert.True (DispatchQueue.GetGlobalQueue (DispatchQualityOfService.Default).Label.StartsWith ("com.apple.root."), "Default"); Assert.True (DispatchQueue.GetGlobalQueue (DispatchQualityOfService.Default).Label.StartsWith ("com.apple.root."), "Default");

Просмотреть файл

@ -12,6 +12,7 @@ using Foundation;
using CoreFoundation; using CoreFoundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreFoundation { namespace MonoTouchFixtures.CoreFoundation {
@ -55,12 +56,12 @@ namespace MonoTouchFixtures.CoreFoundation {
using (CFUrl url = CFUrl.FromFile ("/")) { using (CFUrl url = CFUrl.FromFile ("/")) {
string value = "file://localhost/"; string value = "file://localhost/";
#if __IOS__ #if __IOS__
if (TestRuntime.CheckSystemVersion (PlatformName.iOS, 7, 0)) if (TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 7, 0))
value = "file:///"; value = "file:///";
#elif __WATCHOS__ || __TVOS__ #elif __WATCHOS__ || __TVOS__
value = "file:///"; value = "file:///";
#elif __MACOS__ #elif __MACOS__
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 9)) if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
value = "file:///"; value = "file:///";
#endif #endif

Просмотреть файл

@ -15,6 +15,7 @@ using UIKit;
using PlatformImage = UIKit.UIImage; using PlatformImage = UIKit.UIImage;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreImage namespace MonoTouchFixtures.CoreImage
{ {
@ -122,8 +123,8 @@ namespace MonoTouchFixtures.CoreImage
[Test] [Test]
public void CIKernel_BasicTest () public void CIKernel_BasicTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
Exception ex = null; Exception ex = null;
var t = new Thread (() => { var t = new Thread (() => {
@ -174,8 +175,8 @@ namespace MonoTouchFixtures.CoreImage
[Test] [Test]
public void CIKernel_TestFromPrograms () public void CIKernel_TestFromPrograms ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
CIKernel[] kernels = CIKernel[] kernels =
CIKernel.FromProgramMultiple ( CIKernel.FromProgramMultiple (

Просмотреть файл

@ -19,6 +19,7 @@ using CoreText;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreImage { namespace MonoTouchFixtures.CoreImage {
@ -49,8 +50,8 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void CustomFilterTest () public void CustomFilterTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
MyFilter filter = new MyFilter (); MyFilter filter = new MyFilter ();
Assert.NotNull (filter); Assert.NotNull (filter);
@ -76,8 +77,8 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void ColorSpace () public void ColorSpace ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
using (var f = new CIColorCubeWithColorSpace ()) { using (var f = new CIColorCubeWithColorSpace ()) {
Assert.Null (f.ColorSpace, "ColorSpace/default"); Assert.Null (f.ColorSpace, "ColorSpace/default");

Просмотреть файл

@ -21,6 +21,7 @@ using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreImage { namespace MonoTouchFixtures.CoreImage {
@ -49,7 +50,7 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void WithMetadataDefaults () public void WithMetadataDefaults ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
var options = new CIImageInitializationOptionsWithMetadata (); var options = new CIImageInitializationOptionsWithMetadata ();
Assert.That (options.Dictionary.Count, Is.EqualTo ((nuint) 0), "Count"); Assert.That (options.Dictionary.Count, Is.EqualTo ((nuint) 0), "Count");
@ -59,7 +60,7 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void WithMetadataProperties () public void WithMetadataProperties ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
var suboptions = new CGImageProperties () { var suboptions = new CGImageProperties () {
ProfileName = "Xamarin" ProfileName = "Xamarin"

Просмотреть файл

@ -22,6 +22,7 @@ using CoreImage;
using CoreGraphics; using CoreGraphics;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreImage { namespace MonoTouchFixtures.CoreImage {
@ -32,14 +33,14 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void EmptyImage () public void EmptyImage ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
Assert.IsNull (CIImage.EmptyImage.Properties); Assert.IsNull (CIImage.EmptyImage.Properties);
} }
[Test] [Test]
public void InitializationWithCustomMetadata () public void InitializationWithCustomMetadata ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png");
using (var dp = new CGDataProvider (file)) { using (var dp = new CGDataProvider (file)) {
using (var img = CGImage.FromPNG (dp, null, false, CGColorRenderingIntent.Default)) { using (var img = CGImage.FromPNG (dp, null, false, CGColorRenderingIntent.Default)) {
@ -74,15 +75,15 @@ namespace MonoTouchFixtures.CoreImage {
[Test] [Test]
public void AreaHistogram () public void AreaHistogram ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
// validate that a null NSDictionary is correct (i.e. uses filter defaults) // validate that a null NSDictionary is correct (i.e. uses filter defaults)
using (var h = CIImage.EmptyImage.CreateByFiltering ("CIAreaHistogram", null)) { using (var h = CIImage.EmptyImage.CreateByFiltering ("CIAreaHistogram", null)) {
// broken on simulator/64 bits on iOS9 beta 2 - radar 21564256 -> fixed in beta 4 // broken on simulator/64 bits on iOS9 beta 2 - radar 21564256 -> fixed in beta 4
var success = true; var success = true;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 11)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11))
success = false; success = false;
#endif #endif
if (success) { if (success) {

Просмотреть файл

@ -14,6 +14,7 @@ using UIKit;
using CoreLocation; using CoreLocation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreLocation { namespace MonoTouchFixtures.CoreLocation {
@ -24,7 +25,7 @@ namespace MonoTouchFixtures.CoreLocation {
[Test] [Test]
public void Ctor2 () public void Ctor2 ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0")) using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0"))
using (var br = new CLBeaconRegion (uuid, "identifier")) { using (var br = new CLBeaconRegion (uuid, "identifier")) {
@ -43,7 +44,7 @@ namespace MonoTouchFixtures.CoreLocation {
[Test] [Test]
public void Ctor3 () public void Ctor3 ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0")) using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0"))
using (var br = new CLBeaconRegion (uuid, 0, "identifier")) { using (var br = new CLBeaconRegion (uuid, 0, "identifier")) {
@ -61,7 +62,7 @@ namespace MonoTouchFixtures.CoreLocation {
[Test] [Test]
public void Ctor4 () public void Ctor4 ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0")) using (var uuid = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0"))
using (var br = new CLBeaconRegion (uuid, 2, 3, "identifier")) { using (var br = new CLBeaconRegion (uuid, 2, 3, "identifier")) {

Просмотреть файл

@ -3,6 +3,7 @@ using Foundation;
using CoreMedia; using CoreMedia;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia namespace MonoTouchFixtures.CoreMedia
{ {
@ -15,7 +16,7 @@ namespace MonoTouchFixtures.CoreMedia
[Test] [Test]
public void RetainReleaseTest () public void RetainReleaseTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
var clock = CMClock.HostTimeClock; var clock = CMClock.HostTimeClock;
var timebase = new CMClockOrTimebase (clock.Handle); var timebase = new CMClockOrTimebase (clock.Handle);

Просмотреть файл

@ -14,6 +14,7 @@ using CoreMedia;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -39,7 +40,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void HostTimeClock () public void HostTimeClock ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var clock = CMClock.HostTimeClock) { using (var clock = CMClock.HostTimeClock) {
Assert.That (clock.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle"); Assert.That (clock.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle");

Просмотреть файл

@ -18,6 +18,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -43,7 +44,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void Video () public void Video ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
CMFormatDescriptionError fde; CMFormatDescriptionError fde;
@ -81,7 +82,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void RefcountTest () public void RefcountTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
// Bug #27205 // Bug #27205

Просмотреть файл

@ -11,6 +11,7 @@ using Foundation;
using CoreMedia; using CoreMedia;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -21,7 +22,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void Ctor () public void Ctor ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var mp = new CMMemoryPool ()) using (var mp = new CMMemoryPool ())
{ {
@ -35,7 +36,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CtorAgeOutPeriod () public void CtorAgeOutPeriod ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var mp = new CMMemoryPool (TimeSpan.FromSeconds (40))) using (var mp = new CMMemoryPool (TimeSpan.FromSeconds (40)))
{ {

Просмотреть файл

@ -17,6 +17,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -101,7 +102,7 @@ namespace MonoTouchFixtures.CoreMedia {
public void MultiplyByRatio () public void MultiplyByRatio ()
{ {
TestRuntime.AssertXcodeVersion (5, 1); TestRuntime.AssertXcodeVersion (5, 1);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
var t = new CMTime (1000, 1); var t = new CMTime (1000, 1);
t = CMTime.Multiply (t, 20, 10); t = CMTime.Multiply (t, 20, 10);

Просмотреть файл

@ -11,6 +11,7 @@ using Foundation;
using CoreMedia; using CoreMedia;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -22,7 +23,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void DefaultValues () public void DefaultValues ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
var htc = CMClock.HostTimeClock; var htc = CMClock.HostTimeClock;
using (var tb = new CMTimebase (htc)) { using (var tb = new CMTimebase (htc)) {
@ -43,7 +44,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void SetAnchorTime () public void SetAnchorTime ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var tb = new CMTimebase (CMClock.HostTimeClock)) { using (var tb = new CMTimebase (CMClock.HostTimeClock)) {
Assert.AreEqual (CMTimebaseError.None, tb.SetAnchorTime (new CMTime (1000000, 200), new CMTime (-1, -2))); Assert.AreEqual (CMTimebaseError.None, tb.SetAnchorTime (new CMTime (1000000, 200), new CMTime (-1, -2)));
@ -55,7 +56,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void AddTimer () public void AddTimer ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var tb = new CMTimebase (CMClock.HostTimeClock)) { using (var tb = new CMTimebase (CMClock.HostTimeClock)) {
var timer = NSTimer.CreateRepeatingTimer (CMTimebase.VeryLongTimeInterval, delegate { }); var timer = NSTimer.CreateRepeatingTimer (CMTimebase.VeryLongTimeInterval, delegate { });
@ -71,7 +72,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void GetMasterTests () public void GetMasterTests ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var tb = new CMTimebase (CMClock.HostTimeClock)) { using (var tb = new CMTimebase (CMClock.HostTimeClock)) {
var masterTB = tb.GetMasterTimebase (); var masterTB = tb.GetMasterTimebase ();
@ -92,7 +93,7 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CopyMasterTests () public void CopyMasterTests ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var tb = new CMTimebase (CMClock.HostTimeClock)) { using (var tb = new CMTimebase (CMClock.HostTimeClock)) {
var masterTB = tb.CopyMasterTimebase (); var masterTB = tb.CopyMasterTimebase ();

Просмотреть файл

@ -15,6 +15,7 @@ using ObjCRuntime;
using CoreVideo; using CoreVideo;
using CoreMedia; using CoreMedia;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreMedia { namespace MonoTouchFixtures.CoreMedia {
@ -41,8 +42,8 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CreateReadyWithPacketDescriptions () public void CreateReadyWithPacketDescriptions ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
CMBlockBufferError bbe; CMBlockBufferError bbe;
using (var bb = CMBlockBuffer.CreateEmpty (0, CMBlockBufferFlags.AlwaysCopyData, out bbe)) { using (var bb = CMBlockBuffer.CreateEmpty (0, CMBlockBufferFlags.AlwaysCopyData, out bbe)) {
@ -61,8 +62,8 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CreateReady () public void CreateReady ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
CMBlockBufferError bbe; CMBlockBufferError bbe;
using (var bb = CMBlockBuffer.CreateEmpty (0, CMBlockBufferFlags.AlwaysCopyData, out bbe)) { using (var bb = CMBlockBuffer.CreateEmpty (0, CMBlockBufferFlags.AlwaysCopyData, out bbe)) {
@ -78,8 +79,8 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CreateReadyWithImageBuffer_ArrayValidations () public void CreateReadyWithImageBuffer_ArrayValidations ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
CMFormatDescriptionError fde; CMFormatDescriptionError fde;
using (var pixelBuffer = new CVPixelBuffer (20, 10, CVPixelFormatType.CV24RGB)) using (var pixelBuffer = new CVPixelBuffer (20, 10, CVPixelFormatType.CV24RGB))
@ -96,8 +97,8 @@ namespace MonoTouchFixtures.CoreMedia {
[Test] [Test]
public void CreateReadyWithImageBuffer () public void CreateReadyWithImageBuffer ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
CMFormatDescriptionError fde; CMFormatDescriptionError fde;
using (var pixelBuffer = new CVPixelBuffer (20, 10, CVPixelFormatType.CV24RGB)) using (var pixelBuffer = new CVPixelBuffer (20, 10, CVPixelFormatType.CV24RGB))

Просмотреть файл

@ -6,6 +6,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using CoreVideo; using CoreVideo;
using Xamarin.Utils;
namespace MonoTouchFixtures.CoreVideo { namespace MonoTouchFixtures.CoreVideo {
@ -16,7 +17,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void CreateFromDisplayIdValidIdTest () public void CreateFromDisplayIdValidIdTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
Assert.DoesNotThrow (() => { Assert.DoesNotThrow (() => {
using var displayLink = CVDisplayLink.CreateFromDisplayId ((uint) CGDisplay.MainDisplayID); using var displayLink = CVDisplayLink.CreateFromDisplayId ((uint) CGDisplay.MainDisplayID);
Assert.NotNull (displayLink, "Not null"); Assert.NotNull (displayLink, "Not null");
@ -27,7 +28,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void CreateFromDisplayWrongIdTest () public void CreateFromDisplayWrongIdTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
Assert.DoesNotThrow (() => { Assert.DoesNotThrow (() => {
using var displayLink = CVDisplayLink.CreateFromDisplayId (UInt32.MaxValue); using var displayLink = CVDisplayLink.CreateFromDisplayId (UInt32.MaxValue);
Assert.Null (displayLink, "null"); Assert.Null (displayLink, "null");
@ -37,7 +38,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void CreateFromDisplayIdsTest () public void CreateFromDisplayIdsTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
// we might not have more than one display, therefore we will use an array // we might not have more than one display, therefore we will use an array
// with a single one, there is nothing in the docs that say that we cannot do that // with a single one, there is nothing in the docs that say that we cannot do that
Assert.DoesNotThrow (() => { Assert.DoesNotThrow (() => {
@ -49,7 +50,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void CreateFromOpenGLMaskTest () public void CreateFromOpenGLMaskTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
var openGLMask = CGDisplay.GetOpenGLDisplayMask (CGDisplay.MainDisplayID); var openGLMask = CGDisplay.GetOpenGLDisplayMask (CGDisplay.MainDisplayID);
Assert.DoesNotThrow (() => { Assert.DoesNotThrow (() => {
using var displayLink = CVDisplayLink.CreateFromOpenGLMask ((uint) openGLMask); using var displayLink = CVDisplayLink.CreateFromOpenGLMask ((uint) openGLMask);
@ -77,7 +78,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void GetTypeIdTest () public void GetTypeIdTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
Assert.DoesNotThrow (() => { Assert.DoesNotThrow (() => {
CVDisplayLink.GetTypeId (); CVDisplayLink.GetTypeId ();
}, "Throws"); }, "Throws");
@ -86,7 +87,7 @@ namespace MonoTouchFixtures.CoreVideo {
[Test] [Test]
public void TryTranslateTimeValidTest () public void TryTranslateTimeValidTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 12, 0); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 12, 0);
var outTime = new CVTimeStamp { var outTime = new CVTimeStamp {
Version = 0, Version = 0,
Flags = (1L << 0) | (1L << 1), // kCVTimeStampVideoTimeValid | kCVTimeStampHostTimeValid Flags = (1L << 0) | (1L << 1), // kCVTimeStampVideoTimeValid | kCVTimeStampHostTimeValid

Просмотреть файл

@ -15,6 +15,7 @@ using CoreGraphics;
using EventKit; using EventKit;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.EventKit { namespace MonoTouchFixtures.EventKit {
@ -25,7 +26,7 @@ namespace MonoTouchFixtures.EventKit {
[Test] [Test]
public void NullAllowedTest () public void NullAllowedTest ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
using (var alarm = EKAlarm.FromTimeInterval (1234)) { using (var alarm = EKAlarm.FromTimeInterval (1234)) {
alarm.AbsoluteDate = null; alarm.AbsoluteDate = null;

Просмотреть файл

@ -16,6 +16,7 @@ using CoreGraphics;
using ObjCRuntime; using ObjCRuntime;
using EventKit; using EventKit;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.EventKit { namespace MonoTouchFixtures.EventKit {
@ -25,7 +26,7 @@ namespace MonoTouchFixtures.EventKit {
[SetUp] [SetUp]
public void Setup () public void Setup ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
} }
void RequestPermission () void RequestPermission ()

Просмотреть файл

@ -14,6 +14,7 @@ using EventKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.EventKit { namespace MonoTouchFixtures.EventKit {
@ -24,7 +25,7 @@ namespace MonoTouchFixtures.EventKit {
[SetUp] [SetUp]
public void Setup () public void Setup ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
} }
[Test] [Test]

Просмотреть файл

@ -14,6 +14,7 @@ using Foundation;
using EventKit; using EventKit;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.EventKit { namespace MonoTouchFixtures.EventKit {
@ -25,7 +26,7 @@ namespace MonoTouchFixtures.EventKit {
[SetUp] [SetUp]
public void Setup () public void Setup ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
} }
[Test] [Test]
@ -56,7 +57,7 @@ namespace MonoTouchFixtures.EventKit {
[Test] [Test]
public void Range () public void Range ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var rem = new EKReminder ()) { using (var rem = new EKReminder ()) {
// priority is documented to have a range of 0-9 but there's no validation in ObjC // priority is documented to have a range of 0-9 but there's no validation in ObjC

Просмотреть файл

@ -14,6 +14,7 @@ using Foundation;
using ExternalAccessory; using ExternalAccessory;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.ExternalAccessory { namespace MonoTouchFixtures.ExternalAccessory {
@ -43,7 +44,7 @@ namespace MonoTouchFixtures.ExternalAccessory {
public void ShowBluetoothAccessoryPicker () public void ShowBluetoothAccessoryPicker ()
{ {
// The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check
TestRuntime.AssertSystemVersion (PlatformName.MacCatalyst, 14, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false);
EAAccessoryManager.SharedAccessoryManager.ShowBluetoothAccessoryPicker (null, null); EAAccessoryManager.SharedAccessoryManager.ShowBluetoothAccessoryPicker (null, null);
} }
#endif #endif

Просмотреть файл

@ -12,6 +12,7 @@ using ObjCRuntime;
#if !__WATCHOS__ #if !__WATCHOS__
using CoreText; using CoreText;
#endif #endif
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -84,8 +85,8 @@ namespace MonoTouchFixtures.Foundation {
[Test] [Test]
public void UIKitAttachmentConveniences_New () public void UIKitAttachmentConveniences_New ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
// so we added custom code calling the (old) category helper - but we had to pick a different name // so we added custom code calling the (old) category helper - but we had to pick a different name
using (var ta = new NSTextAttachment (null, null)) using (var ta = new NSTextAttachment (null, null))

Просмотреть файл

@ -2,6 +2,7 @@ using System;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using RectangleF=CoreGraphics.CGRect; using RectangleF=CoreGraphics.CGRect;
using SizeF=CoreGraphics.CGSize; using SizeF=CoreGraphics.CGSize;
@ -90,7 +91,7 @@ namespace MonoTouchFixtures.Foundation {
case NSCalendarType.IslamicTabular: case NSCalendarType.IslamicTabular:
case NSCalendarType.IslamicUmmAlQura: case NSCalendarType.IslamicUmmAlQura:
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10))
continue; continue;
#else #else
if (!TestRuntime.CheckXcodeVersion (6, 0)) if (!TestRuntime.CheckXcodeVersion (6, 0))
@ -220,7 +221,7 @@ namespace MonoTouchFixtures.Foundation {
public void TestAddingByComponents () public void TestAddingByComponents ()
{ {
RequiresIos8 (); RequiresIos8 ();
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
NSDate now = NSDate.Now; NSDate now = NSDate.Now;
NSDate oneDayFromNow = NSCalendar.CurrentCalendar.DateByAddingUnit (NSCalendarUnit.Day, 1, now, NSCalendarOptions.None); NSDate oneDayFromNow = NSCalendar.CurrentCalendar.DateByAddingUnit (NSCalendarUnit.Day, 1, now, NSCalendarOptions.None);

Просмотреть файл

@ -10,6 +10,7 @@
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -21,7 +22,7 @@ namespace MonoTouchFixtures.Foundation {
public void SetValueEnumArray () public void SetValueEnumArray ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
var encodings = new NSStringEncoding [] { NSStringEncoding.ISOLatin1, NSStringEncoding.ISOLatin2 }; var encodings = new NSStringEncoding [] { NSStringEncoding.ISOLatin1, NSStringEncoding.ISOLatin2 };
var edo = new EncodingDetectionOptions () { var edo = new EncodingDetectionOptions () {

Просмотреть файл

@ -8,6 +8,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation namespace MonoTouchFixtures.Foundation
{ {
@ -21,7 +22,7 @@ namespace MonoTouchFixtures.Foundation
void RequiresIos8 () void RequiresIos8 ()
{ {
TestRuntime.AssertXcodeVersion (6, 0); TestRuntime.AssertXcodeVersion (6, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
if (dateComponentsFormatter == null) if (dateComponentsFormatter == null)
dateComponentsFormatter = new NSDateComponentsFormatter (); dateComponentsFormatter = new NSDateComponentsFormatter ();

Просмотреть файл

@ -19,6 +19,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using MonoTests.System.Net.Http; using MonoTests.System.Net.Http;
@ -32,7 +33,7 @@ namespace MonoTouchFixtures.Foundation {
public void ConstructorTest () public void ConstructorTest ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
var bytes = Marshal.AllocHGlobal (1); var bytes = Marshal.AllocHGlobal (1);
var deallocated = false; var deallocated = false;
@ -144,7 +145,7 @@ namespace MonoTouchFixtures.Foundation {
} }
#endif #endif
// Https seems broken on our macOS 10.9 bot, so skip this test. // Https seems broken on our macOS 10.9 bot, so skip this test.
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
// we have network issues, try several urls, if one works, be happy, else fail // we have network issues, try several urls, if one works, be happy, else fail
for (var i = 0; i < NetworkResources.RobotsUrls.Length; i++) { for (var i = 0; i < NetworkResources.RobotsUrls.Length; i++) {
@ -165,7 +166,7 @@ namespace MonoTouchFixtures.Foundation {
public void Base64_Short () public void Base64_Short ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var data = NSData.FromArray (new byte [1] { 42 })) { using (var data = NSData.FromArray (new byte [1] { 42 })) {
string s1 = data.GetBase64EncodedString (NSDataBase64EncodingOptions.EndLineWithCarriageReturn); string s1 = data.GetBase64EncodedString (NSDataBase64EncodingOptions.EndLineWithCarriageReturn);
@ -186,7 +187,7 @@ namespace MonoTouchFixtures.Foundation {
public void Base64_Long () public void Base64_Long ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
byte[] array = new byte [60]; byte[] array = new byte [60];
using (var data = NSData.FromArray (array)) { using (var data = NSData.FromArray (array)) {
@ -337,7 +338,7 @@ namespace MonoTouchFixtures.Foundation {
public void Base64String () public void Base64String ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var d = new NSData ("WGFtYXJpbg==", NSDataBase64DecodingOptions.IgnoreUnknownCharacters)) { using (var d = new NSData ("WGFtYXJpbg==", NSDataBase64DecodingOptions.IgnoreUnknownCharacters)) {
Assert.That (d.ToString (), Is.EqualTo ("Xamarin")); Assert.That (d.ToString (), Is.EqualTo ("Xamarin"));
@ -348,7 +349,7 @@ namespace MonoTouchFixtures.Foundation {
public void Base64Data () public void Base64Data ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var b = NSData.FromString ("WGFtYXJpbg==")) using (var b = NSData.FromString ("WGFtYXJpbg=="))
using (var d = new NSData (b, NSDataBase64DecodingOptions.IgnoreUnknownCharacters)) { using (var d = new NSData (b, NSDataBase64DecodingOptions.IgnoreUnknownCharacters)) {

Просмотреть файл

@ -5,6 +5,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -212,7 +213,7 @@ namespace MonoTouchFixtures.Foundation {
public void IndexerTest () public void IndexerTest ()
{ {
// This test doesn't work on Lion, because Lion returns mutable dictionaries in some places this test asserts that those dictionaries are non-mutable. // This test doesn't work on Lion, because Lion returns mutable dictionaries in some places this test asserts that those dictionaries are non-mutable.
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
IntPtr strkeyptr = IntPtr.Zero; IntPtr strkeyptr = IntPtr.Zero;
IntPtr strobjptr = IntPtr.Zero; IntPtr strobjptr = IntPtr.Zero;
IntPtr objptr; IntPtr objptr;

Просмотреть файл

@ -5,6 +5,7 @@ using System.Reflection;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
[assembly: Preserve (typeof (NSExpression), AllMembers = true)] [assembly: Preserve (typeof (NSExpression), AllMembers = true)]
@ -227,7 +228,7 @@ namespace MonoTouchFixtures.Foundation
public void AnyKeyPropertiesTest () public void AnyKeyPropertiesTest ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
var availableProperties = new List<string> { }; var availableProperties = new List<string> { };
using (var expression = NSExpression.FromAnyKey ()) { using (var expression = NSExpression.FromAnyKey ()) {

Просмотреть файл

@ -11,6 +11,7 @@ using UIKit;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -22,7 +23,7 @@ namespace MonoTouchFixtures.Foundation {
[Test] [Test]
public void FromVisualFormat () public void FromVisualFormat ()
{ {
TestRuntime.AssertSystemVersion (PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
using (var testViewController = new TestViewController ()) { using (var testViewController = new TestViewController ()) {
var constraints = NSLayoutConstraint.FromVisualFormat ("V:|[topLayoutGuide]-[firstLabel]-[secondLabel]", var constraints = NSLayoutConstraint.FromVisualFormat ("V:|[topLayoutGuide]-[firstLabel]-[secondLabel]",

Просмотреть файл

@ -2,6 +2,7 @@ using System.Collections.Generic;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace monotouchtest namespace monotouchtest
{ {
@ -39,7 +40,7 @@ namespace monotouchtest
testString.EnumerateLinguisticTags (range, NSLinguisticTagScheme.Token, NSLinguisticTaggerOptions.OmitWhitespace, null, Enumerator); testString.EnumerateLinguisticTags (range, NSLinguisticTagScheme.Token, NSLinguisticTaggerOptions.OmitWhitespace, null, Enumerator);
var expectedWordCount = 3; var expectedWordCount = 3;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 9)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
expectedWordCount = 4; expectedWordCount = 4;
#endif #endif
Assert.AreEqual (expectedWordCount, words.Count, "Word count: " + string.Join (", ", words)); Assert.AreEqual (expectedWordCount, words.Count, "Word count: " + string.Join (", ", words));
@ -73,7 +74,7 @@ namespace monotouchtest
var tags = testString.GetLinguisticTags (range, NSLinguisticTagScheme.NameOrLexicalClass, NSLinguisticTaggerOptions.OmitWhitespace, null, out tokenRanges); var tags = testString.GetLinguisticTags (range, NSLinguisticTagScheme.NameOrLexicalClass, NSLinguisticTaggerOptions.OmitWhitespace, null, out tokenRanges);
var expectedWordCount = 3; var expectedWordCount = 3;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 9)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
expectedWordCount = 4; expectedWordCount = 4;
#endif #endif
Assert.AreEqual (expectedWordCount, tags.Length, "Tags Length"); Assert.AreEqual (expectedWordCount, tags.Length, "Tags Length");

Просмотреть файл

@ -7,6 +7,7 @@ using NUnit.Framework;
using Foundation; using Foundation;
using ObjCRuntime; using ObjCRuntime;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -143,7 +144,7 @@ namespace MonoTouchFixtures.Foundation {
{ {
var isMutableCopy = false; var isMutableCopy = false;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 8)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
isMutableCopy = true; isMutableCopy = true;
#endif #endif
using (var k = new NSString ("key")) using (var k = new NSString ("key"))

Просмотреть файл

@ -25,6 +25,7 @@ using UIKit;
using PlatformException=Foundation.MonoTouchException; using PlatformException=Foundation.MonoTouchException;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
using RectangleF=CoreGraphics.CGRect; using RectangleF=CoreGraphics.CGRect;
using SizeF=CoreGraphics.CGSize; using SizeF=CoreGraphics.CGSize;
@ -82,7 +83,7 @@ namespace MonoTouchFixtures.Foundation {
} }
var hasSecAccessControl = TestRuntime.CheckXcodeVersion (6, 0); var hasSecAccessControl = TestRuntime.CheckXcodeVersion (6, 0);
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10))
hasSecAccessControl = false; hasSecAccessControl = false;
#endif #endif
if (hasSecAccessControl) { if (hasSecAccessControl) {

Просмотреть файл

@ -23,6 +23,7 @@ using UIStringAttributes = AppKit.NSStringAttributes;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -175,7 +176,7 @@ namespace MonoTouchFixtures.Foundation {
public void DrawingExtensions () public void DrawingExtensions ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 11, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
using (var s = new NSString ("foo")) { using (var s = new NSString ("foo")) {
NSStringDrawingOptions options = NSStringDrawingOptions.OneShot; NSStringDrawingOptions options = NSStringDrawingOptions.OneShot;

Просмотреть файл

@ -19,6 +19,7 @@ using UIKit;
using NUnit.Framework; using NUnit.Framework;
using MonoTouchFixtures.Security; using MonoTouchFixtures.Security;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -44,7 +45,7 @@ namespace MonoTouchFixtures.Foundation {
Assert.Null (creds.Password, "Password"); Assert.Null (creds.Password, "Password");
var expectedPersistence = NSUrlCredentialPersistence.ForSession; var expectedPersistence = NSUrlCredentialPersistence.ForSession;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 8)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
expectedPersistence = (NSUrlCredentialPersistence) uint.MaxValue; expectedPersistence = (NSUrlCredentialPersistence) uint.MaxValue;
#endif #endif
Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence"); Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence");
@ -63,7 +64,7 @@ namespace MonoTouchFixtures.Foundation {
Assert.Null (creds.Password, "Password"); Assert.Null (creds.Password, "Password");
var expectedPersistence = NSUrlCredentialPersistence.ForSession; var expectedPersistence = NSUrlCredentialPersistence.ForSession;
#if __MACOS__ #if __MACOS__
if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 8)) if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
expectedPersistence = (NSUrlCredentialPersistence)uint.MaxValue; expectedPersistence = (NSUrlCredentialPersistence)uint.MaxValue;
#endif #endif
Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence"); Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence");

Просмотреть файл

@ -21,6 +21,7 @@ using UIKit;
using ObjCRuntime; using ObjCRuntime;
using NUnit.Framework; using NUnit.Framework;
using MonoTests.System.Net.Http; using MonoTests.System.Net.Http;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -71,7 +72,7 @@ namespace MonoTouchFixtures.Foundation {
public void RegistrarTest () public void RegistrarTest ()
{ {
// Networking seems broken on our macOS 10.9 bot, so skip this test. // Networking seems broken on our macOS 10.9 bot, so skip this test.
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
Exception ex = null; Exception ex = null;
var done = new ManualResetEvent (false); var done = new ManualResetEvent (false);
@ -131,7 +132,7 @@ namespace MonoTouchFixtures.Foundation {
public override void StartLoading () public override void StartLoading ()
{ {
#if MONOMAC #if MONOMAC
if (TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10)) { if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
if (State == 3) if (State == 3)
State++; State++;
} else { } else {

Просмотреть файл

@ -17,6 +17,7 @@ using AppKit;
using UIKit; using UIKit;
#endif #endif
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Utils;
namespace MonoTouchFixtures.Foundation { namespace MonoTouchFixtures.Foundation {
@ -28,7 +29,7 @@ namespace MonoTouchFixtures.Foundation {
public void BackgroundSessionConfiguration () public void BackgroundSessionConfiguration ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
// https://trello.com/c/F6cyUBFU/70-simple-background-transfer-bo-pang-block-by-an-system-invalidcastexception-in-nsurlsessionconfiguration-backgroundsessionconfigu // https://trello.com/c/F6cyUBFU/70-simple-background-transfer-bo-pang-block-by-an-system-invalidcastexception-in-nsurlsessionconfiguration-backgroundsessionconfigu
using (var session = NSUrlSessionConfiguration.BackgroundSessionConfiguration ("id")) { using (var session = NSUrlSessionConfiguration.BackgroundSessionConfiguration ("id")) {
@ -40,7 +41,7 @@ namespace MonoTouchFixtures.Foundation {
public void Default_Properties () public void Default_Properties ()
{ {
TestRuntime.AssertXcodeVersion (5, 0); TestRuntime.AssertXcodeVersion (5, 0);
TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
var config = NSUrlSessionConfiguration.DefaultSessionConfiguration; var config = NSUrlSessionConfiguration.DefaultSessionConfiguration;
@ -87,7 +88,7 @@ namespace MonoTouchFixtures.Foundation {
var hasSharedContainerIdentifier = true; var hasSharedContainerIdentifier = true;
#if __MACOS__ #if __MACOS__
hasSharedContainerIdentifier = TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10); hasSharedContainerIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
#else #else
hasSharedContainerIdentifier = TestRuntime.CheckXcodeVersion (6, 0); hasSharedContainerIdentifier = TestRuntime.CheckXcodeVersion (6, 0);
#endif #endif
@ -117,7 +118,7 @@ namespace MonoTouchFixtures.Foundation {
var hasProtocolClasses = true; var hasProtocolClasses = true;
#if __MACOS__ #if __MACOS__
hasProtocolClasses = TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 10); hasProtocolClasses = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
#else #else
hasProtocolClasses = TestRuntime.CheckXcodeVersion (6, 0); hasProtocolClasses = TestRuntime.CheckXcodeVersion (6, 0);
#endif #endif

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше