Exemplo n.º 1
0
 public void Test3()
 {
     ISoodaCache c = new SoodaInProcessCache();
     c.Add("Contact", 2, DummyEntry(2), TimeSpan.FromHours(1), false);
     //c.Invalidate("Contact", 2, SoodaCacheInvalidateReason.Updated);
     Assert.IsNotNull(c.Find("Contact", 2));
     Assert.AreEqual(2, c.Find("Contact", 2).DataLoadedMask);
 }
Exemplo n.º 2
0
 public void Test4()
 {
     ISoodaCache c = new SoodaInProcessCache();
     c.Add("Contact", 2, DummyEntry(2), TimeSpan.FromHours(1), false);
     c.Add("Contact", 2, DummyEntry(3), TimeSpan.FromHours(1), false);
     Assert.AreEqual(3, c.Find("Contact", 2).DataLoadedMask);
 }
Exemplo n.º 3
0
 public void Test2()
 {
     ISoodaCache c = new SoodaInProcessCache();
     c.Add("Contact", 2, DummyEntry(2), TimeSpan.FromHours(1), false);
     c.Invalidate("Contact", 2, SoodaCacheInvalidateReason.Updated);
     Assert.IsNull(c.Find("Contact", 2));
 }
 public void Test8()
 {
     SoodaInProcessCache c = new SoodaInProcessCache();
     c.Add("Contact", 1, DummyEntry(1), TimeSpan.FromMilliseconds(150), false);
     c.Add("Contact", 2, DummyEntry(2), TimeSpan.FromMilliseconds(150), false);
     c.Add("Contact", 3, DummyEntry(3), TimeSpan.FromMilliseconds(150), false);
     string ck = "Contact where 1=2";
     c.StoreCollection(ck, "Contact", new int[] { 1, 2, 3 }, new string[] { "Contact", "Group", "Role" }, true, TimeSpan.FromMilliseconds(150), false);
     Assert.IsNotNull(c.Find("Contact", 3));
     System.Threading.Thread.Sleep(200);
     Console.WriteLine("*** Sweeping ***");
     c.Sweep();
     Console.WriteLine("*** Finished ***");
     Assert.IsNull(c.Find("Contact", 3));
 }
 public void Test7()
 {
     SoodaInProcessCache c = new SoodaInProcessCache();
     c.Add("Contact", 3, DummyEntry(3), TimeSpan.FromMilliseconds(50), false);
     Assert.IsNotNull(c.Find("Contact", 3));
     System.Threading.Thread.Sleep(100);
     c.Sweep();
     Assert.IsNull(c.Find("Contact", 3));
 }
Exemplo n.º 6
0
 public void Test1()
 {
     ISoodaCache c = new SoodaInProcessCache();
     Assert.IsNull(c.Find("Contact", 2));
 }