public void Database_has_correct_scope( [Values(CKDatabaseScope.Private, CKDatabaseScope.Public, CKDatabaseScope.Shared)] CKDatabaseScope scope) { var database = CKContainer.DefaultContainer().DatabaseWithDatabaseScope(scope); Assert.AreEqual(database.DatabaseScope, scope); }
/// <summary> /// </summary> /// <param name="databaseScope"></param> /// <returns>val</returns> public CKDatabase DatabaseWithDatabaseScope( CKDatabaseScope databaseScope) { var val = CKContainer_databaseWithDatabaseScope( Handle, (long)databaseScope, out IntPtr exceptionPtr); if (exceptionPtr != IntPtr.Zero) { var nativeException = new NSException(exceptionPtr); throw new CloudKitException(nativeException, nativeException.Reason); } return(val == IntPtr.Zero ? null : new CKDatabase(val)); }
public void Can_retrieve_database_by_scope( [Values(CKDatabaseScope.Private, CKDatabaseScope.Public, CKDatabaseScope.Shared)] CKDatabaseScope scope) { Assert.NotNull(CKContainer.DefaultContainer().DatabaseWithDatabaseScope(scope)); }