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()); }
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()); }