public void Disposable()
        {
            Context context       = new Context();
            int     disposedCount = 0;

            using (SimpleCacheWithContext <DisposableAction, Context> cache = SimpleCache.CreateWithContext(context, (c) => new DisposableAction(() => disposedCount++)))
            {
                var v0 = cache.Value;

                cache.InvalidateCache();
                Assert.Equal(1, disposedCount);

                var v1 = cache.Value;
            }
            Assert.Equal(2, disposedCount);
        }
        public void EvaluationAfterInvalidate()
        {
            Context context = new Context();
            SimpleCacheWithContext <int, Context> cache = SimpleCache.CreateWithContext(context, (c) =>
            {
                c.Count++;
                return(42);
            });

            Assert.Equal(0, context.Count);
            Assert.Equal(42, cache.Value);
            Assert.Equal(1, context.Count);
            Assert.Equal(42, cache.Value);
            Assert.Equal(1, context.Count);
            cache.InvalidateCache();
            Assert.Equal(1, context.Count);
            Assert.Equal(42, cache.Value);
            Assert.Equal(2, context.Count);
        }