Esempio n. 1
0
        public void Using_DisableCaching_Should_Disable_Cache_Inside_Using_Block()
        {
            var repos = new InMemoryRepository <Contact>(new StandardCachingStrategy <Contact>());

            repos.CachingEnabled.ShouldBeTrue();

            using (repos.DisableCaching())
            {
                repos.CachingEnabled.ShouldBeFalse();
            }

            repos.CachingEnabled.ShouldBeTrue();
        }
        public void Using_DisableCaching_Should_Disable_Cache_Inside_Using_Block()
        {
            var repos = new InMemoryRepository<Contact>(new StandardCachingStrategy<Contact>());

            repos.CachingEnabled.ShouldBeTrue();

            using (repos.DisableCaching())
            {
                repos.CachingEnabled.ShouldBeFalse();
            }

            repos.CachingEnabled.ShouldBeTrue();
        }