public void ReplaceEvent() { var eventCache = new EventCacheDictionary(); var eventData = new Hashtable { { 1, 1 } }; string msg; Assert.That(eventCache.MergeEvent(1, 1, eventData, out msg)); var eventData2 = new Hashtable { { 2, 2 } }; eventCache.ReplaceEvent(1, 1, eventData2); EventCache ec; Assert.That(eventCache.TryGetEventCache(1, out ec), Is.True); Hashtable ed; Assert.That(ec.TryGetValue(1, out ed), Is.True); Assert.That(ed, Is.EqualTo(eventData2)); }
public void RemoveCache() { var eventCache = new EventCacheDictionary(); string msg; Assert.That(eventCache.MergeEvent(1, 1, new Hashtable { { 1, 1 } }, out msg)); var eventData = new Hashtable { { 1, 2 } }; Assert.That(eventCache.MergeEvent(1, 1, eventData, out msg), Is.True); EventCache ec; Assert.That(eventCache.TryGetEventCache(1, out ec), Is.True); Assert.That(eventCache.RemoveEventCache(1), Is.True); Assert.That(eventCache.TryGetEventCache(1, out ec), Is.False); }