Exemple #1
0
        public void CanCreateIsolatedStorageCacheManager()
        {
            cacheManager.Add("bab", "foo");
            Assert.AreEqual(1, cacheManager.Count);

            CacheManagerFactory differentFactory      = new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration());
            CacheManager        differentCacheManager = differentFactory.Create("InIsoStorePersistence");

            int count = differentCacheManager.Count;

            differentCacheManager.Dispose();

            Assert.AreEqual(1, count, "If we actually persisted added item, different cache manager should see item, too.");
        }
        public void StartCacheProcesses()
        {
            sharedLock       = new object();
            callbackCount    = 0;
            callbackReason   = CacheItemRemovedReason.Unknown;
            exceptionMessage = "";

            var defaultProvider = TypeRegistrationsProvider.CreateDefaultProvider();

            var registrationProvider = new CompositeTypeRegistrationsProviderLocator(defaultProvider, new RaceConditionSimulatingExpirationTaskRegistrationProvider());

            IUnityContainer     container           = new UnityContainer();
            var                 configurator        = new UnityContainerConfigurator(container);
            UnityServiceLocator unityServiceLocator = new UnityServiceLocator(container);

            EnterpriseLibraryContainer.ConfigureContainer(registrationProvider, configurator, TestConfigurationSource.GenerateConfiguration());

            cacheManager = (CacheManager)unityServiceLocator.GetInstance <ICacheManager>("ShortInMemoryPersistence");
        }
 public void CreateFactory()
 {
     factory = new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration());
 }
        public void StartCacheProcesses()
        {
            sharedLock       = new object();
            callbackCount    = 0;
            callbackReason   = CacheItemRemovedReason.Unknown;
            exceptionMessage = "";

            cacheManager = MockCacheManagerFactory.Create("ShortInMemoryPersistence", TestConfigurationSource.GenerateConfiguration());
        }
Exemple #5
0
 public void CreateCacheManager()
 {
     factory      = new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration());
     cacheManager = factory.Create("InIsoStorePersistence");
     cacheManager.Flush();
 }