public void ShouldDisposeSiteIfNotCached() { var siteMock = new ShimSPSite(); var disposed = false; siteMock.Dispose = () => disposed = true; SaveDataJobExecuteCache.DisposeSite(siteMock); disposed.ShouldBe(true); }
public void ShouldNotDisposeCachedSite() { var siteMock = new ShimSPSite(); var disposed = false; siteMock.Dispose = () => disposed = true; using (SaveDataJobExecuteCache.InitializeCache(siteMock)) { SaveDataJobExecuteCache.DisposeSite(siteMock); } disposed.ShouldBe(false); }