public void Remove_Twice() { var dic = new qckdev.Collections.CacheDictionary <int, string>() { CacheTimeout = TimeSpan.FromMilliseconds(200) }; dic.Add(1, "a"); dic.Add(2, "b"); dic.Add(3, "c"); dic.Remove(1); dic.Remove(1); Assert.AreEqual(2, dic.Count); }
public void Remove_WithDelay() { var dic = new qckdev.Collections.CacheDictionary <int, string>() { CacheTimeout = TimeSpan.FromMilliseconds(200) }; dic.Add(1, "a"); System.Threading.Thread.Sleep(210); dic.Add(2, "b"); dic.Add(3, "c"); dic.Remove(1); Assert.AreEqual(2, dic.Count); }