Catel.Test.Caching.CacheStorageFacts.TheAutoExpireFunctionality.IsAutomaticallyEnabledWhenStartedDisabledButAddingItemWithCustomExpirationPolicy C# (CSharp) Метод

IsAutomaticallyEnabledWhenStartedDisabledButAddingItemWithCustomExpirationPolicy() приватный Метод

            public void IsAutomaticallyEnabledWhenStartedDisabledButAddingItemWithCustomExpirationPolicy()
            {
                var cache = new CacheStorage<string, int>();
                cache.ExpirationTimerInterval = TimeSpan.FromMilliseconds(250);

                cache.Add("1", 1, expiration: new TimeSpan(0, 0, 0, 0, 250));

                Assert.IsTrue(cache.Contains("1"));

                ThreadHelper.Sleep(750);

                Assert.IsFalse(cache.Contains("1"));
            }