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

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

            SaveDataJobExecuteCache.DisposeSite(siteMock);

            disposed.ShouldBe(true);
        }
Example #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);
        }