public void Dispose()
        {
            if (!_isDisposed)
            {
                _asyncSemaphore.Dispose();
                _sourceCacheContext?.Dispose();

                GC.SuppressFinalize(this);
            }

            _isDisposed = true;
        }
Exemple #2
0
            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();
        }
Exemple #4
0
        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));
            }
        }
Exemple #5
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing)
                {
                    _sourceContext?.Dispose();
                }

                _disposedValue = true;
            }
        }
Exemple #6
0
 public void Dispose()
 {
     _context?.Dispose();
 }
Exemple #7
0
 public void Dispose() => _cache.Dispose();
 public void Dispose()
 {
     _sourceCacheContext?.Dispose();
 }
Exemple #9
0
 public void Dispose()
 {
     SourceCache.Dispose();
 }
 public void Dispose()
 {
     _sourceCacheContext.Dispose();
     GC.SuppressFinalize(this);
 }
Exemple #11
0
 public void Dispose()
 {
     _app.Dispose();
     _client.Dispose();
     _cache.Dispose();
 }
Exemple #12
0
 public void Dispose()
 {
     _httpSource.Dispose();
     _sourceCacheContext.Dispose();
 }
 public void Dispose() => _cacheContext.Dispose();