예제 #1
0
        public void SetValue()
        {
            var cache = new MemoryCache(1024, 6000, 20);

            bool result = false;
            Assert.DoesNotThrow(() => result = cache.Set(32, "test"));
            Assert.IsTrue(result);
        }
예제 #2
0
        public void SetAndGetValue()
        {
            var cache = new MemoryCache(1024, 6000, 20);

            Assert.DoesNotThrow(() => {
                Assert.IsTrue(cache.Set(32, "test"));
                Assert.AreEqual("test", cache.Get(32));
            });
        }
예제 #3
0
 public void CreateWithoutErrors()
 {
     MemoryCache cache = null;
     Assert.DoesNotThrow(() => cache = new MemoryCache(1024, 6000, 20));
     Assert.IsNotNull(cache);
 }