示例#1
0
        public void ShouldDisposeSiteIfNotCached()
        {
            var siteMock = new ShimSPSite();
            var disposed = false;

            siteMock.Dispose = () => disposed = true;

            SaveDataJobExecuteCache.DisposeSite(siteMock);

            disposed.ShouldBe(true);
        }
示例#2
0
        public void ShouldNotDisposeCachedSite()
        {
            var siteMock = new ShimSPSite();
            var disposed = false;

            siteMock.Dispose = () => disposed = true;

            using (SaveDataJobExecuteCache.InitializeCache(siteMock))
            {
                SaveDataJobExecuteCache.DisposeSite(siteMock);
            }

            disposed.ShouldBe(false);
        }