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);
    }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 3
0
 public void Can_retrieve_database_by_scope(
     [Values(CKDatabaseScope.Private, CKDatabaseScope.Public, CKDatabaseScope.Shared)]
     CKDatabaseScope scope)
 {
     Assert.NotNull(CKContainer.DefaultContainer().DatabaseWithDatabaseScope(scope));
 }