public void IsSet_NullKey_ThrowsException()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");

            Assert.AreEqual(false, provider.IsSet(null));
            provider.Invalidate("key");
        }
        public void IsSet()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");

            Assert.AreEqual(true, provider.IsSet("key"));
            provider.Invalidate("key");
        }
        public void IsSet_MissingKey_ReturnsFalse()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");

            Assert.AreEqual(false, provider.IsSet("WrongKey"));
            provider.Invalidate("key");
        }
        public void Invalidate_WrongKey_StillReturns()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");

            provider.Invalidate("wrong-key");

            object result = provider.Get("key");
            Assert.AreEqual("value", result.ToString());
            provider.Invalidate("key");
        }
        public void Invalidate()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");

            provider.Invalidate("key");

            object result = provider.Get("key");
            Assert.AreEqual(null, result);
            provider.Invalidate("key");
        }
        public void Set()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");
            object result = provider.Get("key");

            Assert.AreEqual("value", result.ToString());

            provider.Invalidate("key");
        }
        public void Set_ZeroMinutes_AlreadyExpired()
        {
            CachingProvider provider = new CachingProvider();
            provider.Set("key", "value");
            object result = provider.Get("key");

            Assert.AreEqual(null, result);
            provider.Invalidate("key");
        }
 public void Set_NullData_NullArgumentException()
 {
     CachingProvider provider = new CachingProvider();
     provider.Set("key", null);
     provider.Invalidate("key");
 }
 public void Set_NullArgument_NullArgumentException()
 {
     CachingProvider provider = new CachingProvider();
     provider.Set(null, "value");
     provider.Invalidate("key");
 }