예제 #1
0
 private void ClearResumeData()
 {
     CacheStorage.Remove(_keyDestination);
     CacheStorage.Remove(_keyPartiallyLoadedFilename);
     CacheStorage.Remove(_keyFootprint);
     CacheStorage.Remove(_keyLastWriteDate);
 }
예제 #2
0
            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"));
            }
예제 #3
0
            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);
            }
예제 #4
0
 /// <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);
 }
예제 #5
0
            public void RemovesNonExistingValue()
            {
                var cache = new CacheStorage <string, int>();

                cache.Remove("1");
            }
예제 #6
0
            public void ThrowsArgumentNullExceptionForNullKey()
            {
                var cache = new CacheStorage <string, int>();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => cache.Remove(null));
            }
예제 #7
0
            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);
            }
예제 #8
0
 public void RemovesNonExistingValue()
 {
     var cache = new CacheStorage<string, int>();
     cache.Remove("1");
 }
예제 #9
0
            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"));
            }
예제 #10
0
            public void ThrowsArgumentNullExceptionForNullKey()
            {
                var cache = new CacheStorage<string, int>();

                ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => cache.Remove(null));
            }