public void Test() { var dictionary = new AutoEvictingDictionary <string, string>(StringComparer.OrdinalIgnoreCase, 2); dictionary.Add("Test", "DataValue"); Assert.AreEqual("DataValue", dictionary.Get("Test")); Assert.AreEqual("DataValue", dictionary.Get("test")); dictionary.Increment(); Assert.AreEqual("DataValue", dictionary.Get("Test")); dictionary.Increment(); Assert.AreEqual(null, dictionary.Get("Test")); }
public void TestDefault() { var dictionary = new AutoEvictingDictionary <string, string>(); dictionary.Add("Test", "DataValue"); Assert.AreEqual("DataValue", dictionary.Get("Test")); Assert.AreEqual(null, dictionary.Get("test")); dictionary.Increment(); dictionary.Increment(); dictionary.Increment(); Assert.AreEqual("DataValue", dictionary.Get("Test")); dictionary.Increment(); Assert.AreEqual(null, dictionary.Get("Test")); }