public void TestAddRemoveByKey() { LurchTableTest <int, string> test = new LurchTableTest <int, string>(); for (int i = 0; i < 10; i++) { test.Add(i, i.ToString()); } for (int i = 0; i < 10; i++) { Assert.IsTrue(test.ContainsKey(i)); } string cmp; for (int i = 0; i < 10; i++) { Assert.IsTrue(test.TryGetValue(i, out cmp) && cmp == i.ToString()); } for (int i = 0; i < 10; i++) { Assert.IsTrue(test.Remove(i)); } }
public void TestComparer() { var test = new LurchTableTest <string, string>(StringComparer.OrdinalIgnoreCase); test["a"] = "b"; Assert.IsTrue(test.ContainsKey("A")); test = new LurchTableTest <string, string>(StringComparer.OrdinalIgnoreCase); test["a"] = "b"; Assert.IsTrue(test.ContainsKey("A")); }