public void ExpiringList_Snapshot_Does_Not_Refresh_Items() { using (var list = new ExpiringList <string>(10, 1)) { list.Add("1"); _Clock.AddMilliseconds(10); list.Snapshot(); HeartbeatTick(); Assert.AreEqual(0, list.Count); } }
public void ExpiringList_Snapshot_Returns_Collection_Of_Items() { _List.Add("1"); _List.Add("2"); var snapshot = _List.Snapshot(); _List.Clear(); Assert.AreEqual(2, snapshot.Length); Assert.IsTrue(snapshot.Contains("1")); Assert.IsTrue(snapshot.Contains("2")); }