Ejemplo n.º 1
0
        public void DisableCache_SetDisableFlag()
        {
            Assert.AreEqual(Cache.Default, DisableCache.Current);

            var disabler = new DisableCache();

            Assert.AreEqual(Cache.Disabled, DisableCache.Current);

            disabler.Dispose();

            Assert.AreEqual(Cache.Default, DisableCache.Current);
        }
Ejemplo n.º 2
0
        public void DisableCache_SetDisableFlag()
        {
            Assert.AreEqual(CacheSetting.Enabled, DisableCache.Current);

            var disabler = new DisableCache();

            Assert.AreEqual(CacheSetting.Disabled, DisableCache.Current);

            disabler.Dispose();

            Assert.AreEqual(CacheSetting.Enabled, DisableCache.Current);
        }
Ejemplo n.º 3
0
        public void DisableCacheNest_SetDisableFlagTwice()
        {
            Assert.AreEqual(Cache.Default, DisableCache.Current);

            var disabler1 = new DisableCache();
            var disabler2 = new DisableCache();

            Assert.AreEqual(Cache.Disabled, DisableCache.Current);

            disabler1.Dispose();

            Assert.AreEqual(Cache.Disabled, DisableCache.Current);

            disabler2.Dispose();

            Assert.AreEqual(Cache.Default, DisableCache.Current);
        }
Ejemplo n.º 4
0
        public void DisableCacheNest_SetDisableFlagTwice()
        {
            Assert.AreEqual(CacheSetting.Enabled, DisableCache.Current);

            var disabler1 = new DisableCache();
            var disabler2 = new DisableCache();

            Assert.AreEqual(CacheSetting.Disabled, DisableCache.Current);

            disabler1.Dispose();

            Assert.AreEqual(CacheSetting.Disabled, DisableCache.Current);

            disabler2.Dispose();

            Assert.AreEqual(CacheSetting.Enabled, DisableCache.Current);
        }