public void StartCacheProcesses() { factory = new CacheManagerFactory(Context); shortCacheManager = factory.GetCacheManager("ShortInMemoryPersistence"); smallCacheManager = factory.GetCacheManager("SmallInMemoryPersistence"); expiredKeys = ""; expiredValues = ""; removalReasons = ""; }
public override void FixtureSetup() { base.FixtureSetup(); CacheManagerFactory factory = new CacheManagerFactory(Context); cache = factory.GetCacheManager("InDatabasePersistence"); }
public void GetCacheManagerWithNullEncryption() { CacheManagerFactory factory = new CacheManagerFactory(Context); CacheManager mgr = factory.GetCacheManager("InMemoryPersistenceWithNullEncryption"); CacheManagerTest(mgr); }
public void CreateCache() { removedKey = null; expiredValue = null; removalReason = CacheItemRemovedReason.Unknown; factory = new CacheManagerFactory(Context); cacheMgr = factory.GetCacheManager("SmallInMemoryPersistence"); }
public void CallingDifferentFactoryTwiceReturnsDifferentInstances() { CacheManager cacheOne = factory.GetCacheManager("InMemoryPersistence"); CacheManagerFactory secondFactory = new CacheManagerFactory(Context); CacheManager cacheTwo = secondFactory.GetCacheManager("InMemoryPersistence"); Assert.IsFalse(object.ReferenceEquals(cacheOne, cacheTwo), "Different factories should always return different instances for same instance name"); }
public void StartCacheProcesses() { sharedLock = new object(); callbackCount = 0; callbackReason = CacheItemRemovedReason.Unknown; exceptionMessage = ""; factory = new MockCacheManagerFactory(Context); cacheManager = factory.GetCacheManager("ShortInMemoryPersistence"); }
protected ServiceBase() { CacheManagerFactory = DependencyManager.Current.Resolver.GetService <ICacheManagerFactory>(); CacheManager = CacheManagerFactory.GetCacheManager(); ActionContext = ActionContextFactory.GetActionContext(); Logger = LoggerFactory.GetLoggerInstance(); }
public void CanCreateIsolatedStorageCacheManager() { cacheManager.Add("bab", "foo"); Assert.AreEqual(1, cacheManager.Count); CacheManagerFactory differentFactory = new CacheManagerFactory(Context); CacheManager differentCacheManager = differentFactory.GetCacheManager("InIsoStorePersistence"); int count = differentCacheManager.Count; differentCacheManager.Dispose(); Assert.AreEqual(1, count, "If we actually persisted added item, different cache manager should see item, too."); }
private void CacheManagerTest(string instanceName) { CacheManagerFactory factory = new CacheManagerFactory(Context); CacheManager mgr = factory.GetCacheManager(instanceName); string key = "key1"; string val = "value123"; mgr.Add(key, val); string result = (string)mgr.GetData(key); Assert.AreEqual(val, result, "result"); }
public override void FixtureSetup() { base.FixtureSetup (); CacheManagerFactory factory = new CacheManagerFactory(Context); cache = factory.GetCacheManager("InDatabasePersistence"); }
public void CreateNamedCacheInstance() { CacheManager cache = factory.GetCacheManager("InMemoryPersistence"); Assert.IsNotNull(cache, "Should have created caching instance through factory"); }
public void CreateCacheManager() { factory = new CacheManagerFactory(Context); cacheManager = factory.GetCacheManager("InIsoStorePersistence"); }