Example #1
0
        public void DoesNotFindExpiredKeys()
        {
            cache.Contains("key1").Should().BeFalse();
            cache.Contains("key2").Should().BeFalse();

            cache.Add("key1", 100);

            cache.Contains("key1").Should().BeTrue();
            cache.Contains("key2").Should().BeFalse();

            Thread.Sleep(200);

            cache.Contains("key1").Should().BeFalse();
            cache.Contains("key2").Should().BeFalse();
        }
 public void PreventFuturePersistence(StoreNumber storeNumber) => _cacheWithExpiration.Add(storeNumber.ToString(), _expirationMs);