public void TestPut()
        {
            const string key   = "key1";
            const string value = "value";

            ICache cache = provider.BuildCache("nunit", props);

            Assert.IsNotNull(cache, "no cache returned");

            Assert.IsNull(cache.Get(key), "cache returned an item we didn't add !?!");

            cache.Put(key, value);
            object item = cache.Get(key);

            Assert.IsNotNull(item);
            Assert.AreEqual(value, item, "didn't return the item we added");
        }
示例#2
0
        public void TestPut()
        {
            string key   = "key1";
            string value = "value";

            ICache cache = provider.BuildCache("nunit", props);

            Assert.IsNotNull(cache, "no cache returned");

            if (cache.Get(key) != null)
            {
                cache.Remove(key);
            }

            Assert.ShouldNotBeNull(cache.Get(key), "cache returned an item we didn't add !?!");

            cache.Put(key, value);
            Thread.Sleep(100);
            object item = cache.Get(key);

            Assert.IsNotNull(item);
            Assert.AreEqual(value, item, "didn't return the item we added");
        }
示例#3
0
        public void Put()
        {
            const string key   = "key1";
            const string value = "value";

            ICache cache = _provider.BuildCache("NSoft.NFramework", _props);

            Assert.IsNotNull(cache);

            Assert.IsNull(cache.Get(key));

            cache.Put(key, value);

            object item = cache.Get(key);

            Assert.IsNotNull(item);
            Assert.AreEqual(value, item);
        }
        public void TestBuildCacheFromConfig()
        {
            ICache cache = provider.BuildCache("foo", null);

            Assert.IsNotNull(cache, "pre-configured cache not found");
        }