Catel.Test.Caching.CacheStorageFacts.TheGetFromCacheOrFetchMethod.AddsItemToCacheWithOverrideAndReturnsIt C# (CSharp) Method

AddsItemToCacheWithOverrideAndReturnsIt() private method

private AddsItemToCacheWithOverrideAndReturnsIt ( ) : void
return void
            public void AddsItemToCacheWithOverrideAndReturnsIt()
            {
                var cache = new CacheStorage<string, int>();

                cache.Add("1", 1);
                var value = cache.GetFromCacheOrFetch("1", () => 2, true);

                Assert.IsTrue(cache.Contains("1"));
                Assert.AreEqual(2, cache["1"]);
                Assert.AreEqual(2, value);
            }
        }