public void TestGetAndSet() { CyclingHash hash = new CyclingHash(); hash.Add("A", "a"); hash.Add("B", "b"); hash.Add("C", "c"); Assert.AreEqual(hash.ContainsKey("B"), true); Assert.AreEqual(hash.GetCurrentData(), "C"); Assert.AreEqual(hash.GetValue("A"), "a"); }
public void TestGetAndSet() { CyclingHash hash = new CyclingHash(); hash.Add("A", "a"); hash.Add("B", "b"); hash.Add("C", "c"); Assert.AreEqual(hash.ContainsKey("B"), true); Assert.AreEqual(hash.GetCurrentData(), "C"); Assert.AreEqual(hash.GetValue("A"), "a"); }
/// <summary> /// 获取当前关键词对应的值 /// </summary> private object GetItem(object key) { return(_table.GetValue(key)); }