コード例 #1
0
ファイル: DisableTest.cs プロジェクト: KBoudich/mbcache
        public void ShouldTurnOffCachingOfMethodAndEvictCache()
        {
            var comp   = factory.Create <IObjectReturningNewGuids>();
            var orgRes = comp.CachedMethod();

            factory.DisableCache <IObjectReturningNewGuids>();
            var newRes = comp.CachedMethod();

            comp.CachedMethod().Should().Not.Be.EqualTo(newRes);
            factory.EnableCache <IObjectReturningNewGuids>();
            comp.CachedMethod().Should().Not.Be.EqualTo(orgRes);
        }