Beispiel #1
0
 public void ClearAllCachesTest()
 {
     const string prefix = "123123af";
     var fk1 = FullKey(prefix, "111");
     var fk2 = FullKey(prefix, "222");
     var memoryCache = new MemoryCache("sdgkmnsdlkghn");
     _objectCacheFactory.Setup(x => x.Create()).Returns(memoryCache).Verifiable();
     Assert.AreEqual(0, memoryCache.GetCount());
     memoryCache.Add(fk1, new MemoryCacherTests.One(), new CacheItemPolicy());
     memoryCache.Add(fk2, new MemoryCacherTests.One(), new CacheItemPolicy());
     Assert.AreEqual(2, memoryCache.Count());
     new CacheCleaner(_objectCacheFactory.Object).Clean();
     Assert.AreEqual(0, memoryCache.GetCount());
 }