public void Dispose() { if (!_isDisposed) { _asyncSemaphore.Dispose(); _sourceCacheContext?.Dispose(); GC.SuppressFinalize(this); } _isDisposed = true; }
public void Dispose() { SourceCacheContext.Dispose(); TestDirectory.Dispose(); GC.SuppressFinalize(this); }
/// <summary> /// Releases the resources of the object. /// </summary> public void Dispose() { if (Disposed) { return; } Disposed = true; cache.Dispose(); }
public void SourceCacheContext_DisposeDeletesGeneratedTempFolder() { // Arrange string directoryPath; using (var target = new SourceCacheContext()) { directoryPath = target.GeneratedTempFolder; Directory.CreateDirectory(directoryPath); var filePath = Path.Combine(directoryPath, "test.txt"); File.WriteAllText(filePath, string.Empty); // Act target.Dispose(); target.Dispose(); // Assert Assert.False(Directory.Exists(directoryPath)); Assert.False(File.Exists(filePath)); } }
protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _sourceContext?.Dispose(); } _disposedValue = true; } }
public void Dispose() { _context?.Dispose(); }
public void Dispose() => _cache.Dispose();
public void Dispose() { _sourceCacheContext?.Dispose(); }
public void Dispose() { SourceCache.Dispose(); }
public void Dispose() { _sourceCacheContext.Dispose(); GC.SuppressFinalize(this); }
public void Dispose() { _app.Dispose(); _client.Dispose(); _cache.Dispose(); }
public void Dispose() { _httpSource.Dispose(); _sourceCacheContext.Dispose(); }
public void Dispose() => _cacheContext.Dispose();