public void Setup() { TestRuntime.AssertSystemVersion(ApplePlatform.WatchOS, 3, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion(ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion(ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false); }
public void ShowBluetoothAccessoryPicker() { // The API here was introduced to Mac Catalyst later than for the other frameworks, so we have this additional check TestRuntime.AssertSystemVersion(ApplePlatform.MacCatalyst, 14, 0, throwIfOtherPlatform: false); EAAccessoryManager.SharedAccessoryManager.ShowBluetoothAccessoryPicker(null, null); }
public void Setup() { TestRuntime.AssertXcodeVersion(9, 0); // 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); }
public void PreparePrerollAds_New () { TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false); AVPlayerViewController.PrepareForPrerollAds (); }
public void Default_Properties() { TestRuntime.AssertXcodeVersion(5, 0); TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); var config = NSUrlSessionConfiguration.DefaultSessionConfiguration; // in iOS9 those selectors do not respond - but they do work (forwarded to __NSCFURLSessionConfiguration type ?) Assert.True(config.AllowsCellularAccess, "allowsCellularAccess"); config.AllowsCellularAccess = config.AllowsCellularAccess; // setAllowsCellularAccess: Assert.Null(config.ConnectionProxyDictionary, "connectionProxyDictionary"); config.ConnectionProxyDictionary = null; // setConnectionProxyDictionary: Assert.False(config.Discretionary, "isDiscretionary"); config.Discretionary = config.Discretionary; // setDiscretionary: Assert.Null(config.HttpAdditionalHeaders, "HTTPAdditionalHeaders"); config.HttpAdditionalHeaders = config.HttpAdditionalHeaders; // setHTTPAdditionalHeaders: Assert.That(config.HttpCookieAcceptPolicy, Is.EqualTo(NSHttpCookieAcceptPolicy.OnlyFromMainDocumentDomain), "HTTPCookieAcceptPolicy"); config.HttpCookieAcceptPolicy = config.HttpCookieAcceptPolicy; // setHTTPCookieAcceptPolicy: Assert.NotNull(config.HttpCookieStorage, "HTTPCookieStorage"); config.HttpCookieStorage = config.HttpCookieStorage; // setHTTPCookieStorage: // iOS 7.x returned 6 (instead of 4) Assert.That(config.HttpMaximumConnectionsPerHost, Is.GreaterThanOrEqualTo((nint)4), "HTTPMaximumConnectionsPerHost"); config.HttpMaximumConnectionsPerHost = config.HttpMaximumConnectionsPerHost; // setHTTPMaximumConnectionsPerHost: Assert.True(config.HttpShouldSetCookies, "HTTPShouldSetCookies"); config.HttpShouldSetCookies = config.HttpShouldSetCookies; // setHTTPShouldSetCookies: Assert.False(config.HttpShouldUsePipelining, "HTTPShouldUsePipelining"); config.HttpShouldUsePipelining = config.HttpShouldUsePipelining; // setHTTPShouldUsePipelining: Assert.Null(config.Identifier, "identifier"); Assert.That(config.NetworkServiceType, Is.EqualTo(NSUrlRequestNetworkServiceType.Default), "networkServiceType"); config.NetworkServiceType = config.NetworkServiceType; // setNetworkServiceType: Assert.That(config.RequestCachePolicy, Is.EqualTo(NSUrlRequestCachePolicy.UseProtocolCachePolicy), "requestCachePolicy"); config.RequestCachePolicy = config.RequestCachePolicy; // setRequestCachePolicy: Assert.False(config.SessionSendsLaunchEvents, "sessionSendsLaunchEvents"); config.SessionSendsLaunchEvents = config.SessionSendsLaunchEvents; // setSessionSendsLaunchEvents: var hasSharedContainerIdentifier = true; #if __MACOS__ hasSharedContainerIdentifier = TestRuntime.CheckSystemVersion(PlatformName.MacOSX, 10, 10); #else hasSharedContainerIdentifier = TestRuntime.CheckXcodeVersion(6, 0); #endif if (hasSharedContainerIdentifier) { Assert.Null(config.SharedContainerIdentifier, "sharedContainerIdentifier"); config.SharedContainerIdentifier = config.SharedContainerIdentifier; // setSharedContainerIdentifier: } Assert.That(config.TimeoutIntervalForRequest, Is.GreaterThan(0), "timeoutIntervalForRequest"); config.TimeoutIntervalForRequest = config.TimeoutIntervalForRequest; // setTimeoutIntervalForRequest: Assert.That(config.TimeoutIntervalForResource, Is.GreaterThan(0), "timeoutIntervalForResource"); config.TimeoutIntervalForResource = config.TimeoutIntervalForResource; // setTimeoutIntervalForResource: var max = TestRuntime.CheckXcodeVersion(8, 0) ? SslProtocol.Unknown : SslProtocol.Tls_1_2; // Unknown also means default Assert.That(config.TLSMaximumSupportedProtocol, Is.EqualTo(max), "TLSMaximumSupportedProtocol"); config.TLSMaximumSupportedProtocol = config.TLSMaximumSupportedProtocol; // setTLSMaximumSupportedProtocol: Assert.That(config.TLSMinimumSupportedProtocol, Is.GreaterThanOrEqualTo(SslProtocol.Ssl_3_0), "TLSMinimumSupportedProtocol"); config.TLSMinimumSupportedProtocol = config.TLSMinimumSupportedProtocol; // setTLSMinimumSupportedProtocol: Assert.NotNull(config.URLCache, "URLCache"); config.URLCache = config.URLCache; // setURLCache: Assert.NotNull(config.URLCredentialStorage, "URLCredentialStorage"); config.URLCredentialStorage = config.URLCredentialStorage; // setURLCredentialStorage: var hasProtocolClasses = true; #if __MACOS__ hasProtocolClasses = TestRuntime.CheckSystemVersion(PlatformName.MacOSX, 10, 10); #else hasProtocolClasses = TestRuntime.CheckXcodeVersion(6, 0); #endif if (hasProtocolClasses) { Assert.NotNull(config.WeakProtocolClasses, "protocolClasses"); } else { Assert.Null(config.WeakProtocolClasses, "protocolClasses"); } config.WeakProtocolClasses = config.WeakProtocolClasses; // setProtocolClasses: }
public void Fields() { TestRuntime.AssertSystemVersion(PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); // just to confirm it's not an NSUrl but an NSString Assert.That(UIDocument.UserActivityDocumentUrlKey.ToString(), Is.EqualTo("NSUserActivityDocumentURL"), "NSUserActivityDocumentURLKey"); }
public void InterstitialAds_New() { TestRuntime.AssertSystemVersion(PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); UIViewController.PrepareForInterstitialAds(); }
public void SetUp() { TestRuntime.AssertSystemVersion(PlatformName.iOS, 8, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); }
public void EmptyImage() { TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); Assert.IsNull(CIImage.EmptyImage.Properties); }