public void CleanUp_HasOneExpiredItem_CountIsOne() { using (var timedDictionary = new TimedDictionary <int, int>(TimeSpan.MaxValue)) { timedDictionary.TryAdd(1, 1); timedDictionary.CleanUp(); Assert.AreEqual(1, timedDictionary.Count); } }
public void CleanUp_HasOneExpiredItem_CountIsZero() { using (var timedDictionary = new TimedDictionary <int, int>(TimeSpan.FromMilliseconds(0))) { timedDictionary.TryAdd(1, 1); Thread.Sleep(1); timedDictionary.CleanUp(); Assert.AreEqual(0, timedDictionary.Count); } }