public void TestInitialize() { CacheManagerFactory factory = new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration()); cache = factory.Create("InDatabasePersistence"); }
public void ItemsInitializeTheirExpirationsProperlyWhenLoaded() { cache.Add("key", "value", CacheItemPriority.Normal, null, new MockExpiration()); initializationCount = 0; // reset the initializations. CacheManager differentCacheManager = (CacheManager) new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration()).Create("SecondInDatabasePersistence"); differentCacheManager.Dispose(); Assert.AreEqual(1, initializationCount, "Act of creating new cache manager should have caused items to be loaded, initializing expirations"); }