Exemple #1
0
        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");
        }
Exemple #2
0
 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");
 }
Exemple #3
0
 /// <summary>
 /// 获取当前关键词对应的值
 /// </summary>
 private object GetItem(object key)
 {
     return(_table.GetValue(key));
 }