Esempio n. 1
0
        public void ToString_Should_Get_Cached_Value()
        {
            CacheValue <string> value = new CacheValue <string>("value", true);

            Assert.Equal("value", value.ToString());
        }
Esempio n. 2
0
        public void ToString_Should_Get_Null_Value()
        {
            CacheValue <string> value = CacheValue <string> .Null;

            Assert.Equal("<null>", value.ToString());
        }
Esempio n. 3
0
        public bool Set(CacheKey key, CacheValue value)
        {
            if (this.logger != null)
            {
                this.logger.Log("Set " + key.ToString() + ":" + value.ToString(), Category.Info, Priority.Medium);
            }

            if (this.Remove(key) == false)
            {
                return false;
            }

            return this.mediums[0].Set(key, value);
        }