Ejemplo n.º 1
0
        public void CleanAllCaches_RemovesExpiredCacheItems_Success()
        {
            CacheManagerFactory sut = new CacheManagerFactory();

            try
            {
                CacheManager testCache = sut.CreateCache("clear all", new TimeSpan(0, 0, 0, 0, 15), false, true);

                Assert.IsNotNull(testCache);
                testCache.Add("test 1", new CacheItem("test 1", true));

                Assert.AreEqual(1, testCache.Count);

                Thread.Sleep(30);

                sut.CleanAllCaches();

                Assert.AreEqual(0, testCache.Count);
            }
            finally
            {
                sut.RemoveCache("clear all");
            }
        }