public void ExpiringDictionary_Will_Not_Expire_Items_Before_ExpireMilliseconds_Has_Passed() { using (var map = new ExpiringDictionary <int, string>(10, 1)) { map.Add(1, "Hello"); HeartbeatTick(); _Clock.AddMilliseconds(9); HeartbeatTick(); Assert.AreEqual(1, map.Count); _Clock.AddMilliseconds(1); HeartbeatTick(); Assert.AreEqual(0, map.Count); } }
public void ExpiringList_Will_Not_Expire_Items_Before_ExpireMilliseconds_Has_Passed() { using (var list = new ExpiringList <string>(10, 1)) { list.Add("Hello"); HeartbeatTick(); _Clock.AddMilliseconds(9); HeartbeatTick(); Assert.AreEqual(1, list.Count); _Clock.AddMilliseconds(1); HeartbeatTick(); Assert.AreEqual(0, list.Count); } }
public void AircraftOnlineLookup_Lookup_Passes_Icao_To_Provider() { _Lookup.Lookup("ABC123"); _Clock.AddMilliseconds(60000); _Heartbeat.Raise(r => r.FastTick += null, EventArgs.Empty); Assert.AreEqual(1, _RequestedIcaos.Length); Assert.AreEqual("ABC123", _RequestedIcaos[0]); }