Example #1
0
 public void TestGetAndIncrementGetAndDecrement()
 {
     CacheClass cacheClass = new CacheClass();
       cacheClass.Age = 19;
       cacheClass.Name = "Kang";
       Backendless.Cache.Put(DEFAULT_CACHE_KEY, cacheClass);
       Boolean isExist = Backendless.Cache.Contains(DEFAULT_CACHE_KEY);
       Assert.AreEqual(isExist, true, "Server returned a count with wrong value");
       CacheClass getCacheClass = Backendless.Cache.Get<CacheClass>(DEFAULT_CACHE_KEY);
       Assert.AreEqual(cacheClass.Age, getCacheClass.Age, "Server returned a count with wrong value");
       Assert.AreEqual(cacheClass.Name, getCacheClass.Name, "Server returned a count with wrong value");
       Backendless.Cache.Delete(DEFAULT_CACHE_KEY);
       isExist = Backendless.Cache.Contains(DEFAULT_CACHE_KEY);
       Assert.AreEqual(isExist, false, "Server returned a count with wrong value");
 }
Example #2
0
 public void TestGetPointsByMetadata()
 {
     RunAndAwait( () =>
     {
       CacheClass cacheClass = new CacheClass();
       cacheClass.Age = 19;
       cacheClass.Name = "Kang";
       Backendless.Cache.Put(DEFAULT_CACHE_KEY, cacheClass, new AsyncCallback<object>(
     r =>
     {
       Backendless.Cache.Contains(DEFAULT_CACHE_KEY, new AsyncCallback<Boolean>(
         r2 =>
         {
           Assert.AreEqual(r2, true, "Server returned a count with wrong value");
           Backendless.Cache.Get<CacheClass>(DEFAULT_CACHE_KEY, new AsyncCallback<CacheClass>(
             r3 =>
             {
               Assert.AreEqual(cacheClass.Age, r3.Age, "Server returned a count with wrong value");
               Assert.AreEqual(cacheClass.Name, r3.Name, "Server returned a count with wrong value");
               Backendless.Cache.Delete(DEFAULT_CACHE_KEY, new AsyncCallback<object>(
                 r4 =>
                 {
                   Backendless.Cache.Contains(DEFAULT_CACHE_KEY, new AsyncCallback<Boolean>(
                   r5 =>
                   {
                     Assert.AreEqual(r5, false, "Server returned a count with wrong value");
                     CountDown();
                   },
                   f5 => FailCountDownWith(f5)));
                 },
                 f4 => FailCountDownWith(f4)));
             },
             f3 => FailCountDownWith(f3)));
         },
         f2 => FailCountDownWith(f2)));
     },
     f => FailCountDownWith(f)));
     } );
 }
 public SQLSysViews(IDataProvider provider) :this()
 {
     Cache = new CacheClass(provider, this);
 }