private void ClearResumeData() { CacheStorage.Remove(_keyDestination); CacheStorage.Remove(_keyPartiallyLoadedFilename); CacheStorage.Remove(_keyFootprint); CacheStorage.Remove(_keyLastWriteDate); }
public void RemovesExistingValue() { var cache = new CacheStorage <string, int>(); cache.Add("1", 1); Assert.IsTrue(cache.Contains("1")); cache.Remove("1"); Assert.IsFalse(cache.Contains("1")); }
public void DoesNotDisposeItemOnRemoveWhenDisposingNotEnabled() { var disposable = new CustomDisposable(); var cache = new CacheStorage <string, CustomDisposable>(); cache.ExpirationTimerInterval = TimeSpan.FromMilliseconds(250); cache.Add("disposable", disposable, expiration: TimeSpan.FromMilliseconds(250)); Assert.IsFalse(disposable.IsDiposed); cache.Remove("disposable"); Assert.IsFalse(disposable.IsDiposed); }
/// <summary> /// Handles the <see cref="E:SerializationManagerCacheInvalidated" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="CacheInvalidatedEventArgs"/> instance containing the event data.</param> private void OnSerializationManagerCacheInvalidated(object sender, CacheInvalidatedEventArgs e) { _serializationModelCache.Remove(e.Type); }
public void RemovesNonExistingValue() { var cache = new CacheStorage <string, int>(); cache.Remove("1"); }
public void ThrowsArgumentNullExceptionForNullKey() { var cache = new CacheStorage <string, int>(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => cache.Remove(null)); }
public void DoesNotDisposeItemOnRemoveWhenDisposingNotEnabled() { var disposable = new CustomDisposable(); var cache = new CacheStorage<string, CustomDisposable>(); cache.ExpirationTimerInterval = TimeSpan.FromMilliseconds(250); cache.Add("disposable", disposable, expiration: TimeSpan.FromMilliseconds(250)); Assert.IsFalse(disposable.IsDiposed); cache.Remove("disposable"); Assert.IsFalse(disposable.IsDiposed); }
public void RemovesNonExistingValue() { var cache = new CacheStorage<string, int>(); cache.Remove("1"); }
public void RemovesExistingValue() { var cache = new CacheStorage<string, int>(); cache.Add("1", 1); Assert.IsTrue(cache.Contains("1")); cache.Remove("1"); Assert.IsFalse(cache.Contains("1")); }
public void ThrowsArgumentNullExceptionForNullKey() { var cache = new CacheStorage<string, int>(); ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => cache.Remove(null)); }