public void TestClearAllCaches() { using (var externalCache = new ExternalCache()) { // ReSharper disable once InconsistentNaming using (var _item = new ExternalCacheItem()) { _item["P1"] = "Property 1"; externalCache.Add("Item 1", _item); } var item = (ExternalCacheItem)externalCache.Get("Item 1"); Assert.AreEqual("Property 1", item["P1"]); externalCache.Select("Cache 2"); externalCache.Add("Item 2", item); item = (ExternalCacheItem)externalCache.Get("Item 2"); Assert.AreEqual("Property 1", item["P1"]); using (var externalCacheManager = new ExternalCacheManager()) externalCacheManager.ClearAllCaches(); Thread.Sleep(1000); item = (ExternalCacheItem)externalCache.Get("Item 1"); Assert.IsNull(item); item = (ExternalCacheItem)externalCache.Get("Item 2"); Assert.IsNull(item); externalCache.Select("default"); item = (ExternalCacheItem)externalCache.Get("Item 1"); Assert.IsNull(item); item = (ExternalCacheItem)externalCache.Get("Item 2"); Assert.IsNull(item); } }
public void TestCleanup() { using (var externalCacheManager = new ExternalCacheManager()) externalCacheManager.ClearAllCaches(); Thread.Sleep(1000); }
public void TestInitialize() { using (var externalCacheManager = new ExternalCacheManager()) externalCacheManager.SetCacheExpirationCycleCheck(500); }