예제 #1
0
        public void Can_Clear_By_Search()
        {
            var cacheContent1 = new MacroCacheContent();
            var cacheContent2 = new MacroCacheContent();
            var cacheContent3 = new MacroCacheContent();
            var cacheContent4 = new LiteralControl();

            AppCache.Get("Test1", () => cacheContent1);
            AppCache.Get("Tester2", () => cacheContent2);
            AppCache.Get("Tes3", () => cacheContent3);
            AppCache.Get("different4", () => cacheContent4);

            Assert.AreEqual(4, GetTotalItemCount);

            AppCache.ClearByKey("Test");

            Assert.AreEqual(2, GetTotalItemCount);
        }