예제 #1
0
        public void EvictEmpty()
        {
            var memCache = new MemCache(100, Scheduler.Default); //Consider using mock
            var strategy = new RandomEvictionStrategy(memCache);

            strategy.EvictEntry();
            Assert.IsFalse(memCache.Keys.Any());
        }
예제 #2
0
        public void EvictSingle()
        {
            var memCache = new MemCache(100); //Consider using mock

            memCache.Add("mykey", 0, DateTime.MaxValue, new byte[] {});
            var strategy = new RandomEvictionStrategy(memCache);

            strategy.EvictEntry();
            Assert.AreEqual(0, memCache.Keys.Count());
        }