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

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

            Assert.Equal("<null>", value.ToString());
        }
Exemplo 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);
        }