예제 #1
0
 public void TestUploadWithAcl()
 {
     Task.Run(async() =>
     {
         var str  = "1,2,3";
         var data = System.Text.Encoding.ASCII.GetBytes(str);
         var file = new NCMBFile("test2.csv", data, "text/csv");
         var acl  = new NCMBAcl();
         acl.SetPublicReadAccess(true);
         acl.SetPublicWriteAccess(true);
         file.SetAcl(acl);
         await file.Save();
         Assert.NotNull(file.Get("fileName"));
     }).GetAwaiter().GetResult();
 }
예제 #2
0
 public void TestSaveAndDeleteWithAclSync()
 {
     Task.Run(async() =>
     {
         var message = "Hello, world";
         var item    = new NCMBObject("DataStoreTest");
         item.Set("message", message);
         var acl = new NCMBAcl();
         acl.SetPublicReadAccess(true);
         acl.SetPublicWriteAccess(false);
         acl.SetRoleReadAccess("admin", true);
         acl.SetRoleWriteAccess("admin", true);
         item.SetAcl(acl);
         await item.Save();
         Assert.NotNull(item.Get("objectId"));
         Assert.AreEqual(item.Get("message").ToString(), message);
     }).GetAwaiter().GetResult();
 }