public void NonNullDictionary_Unit_ContainsKey_KeyIsNull() { IDictionary<String, String> dictionary = new Dictionary<String, String>() { { "Key1", "Value1" }, { "Key2", "Value2" }, { "Key3", "Value3" } }; NonNullDictionary<String, String> target = new NonNullDictionary<String, String>(dictionary); String key = null; target.ContainsKey(key); }
public void NonNullDictionary_Unit_Remove1_Optimal() { IDictionary<String, String> dictionary = new Dictionary<String, String>() { { "Key1", "Value1" }, { "Key2", "Value2" }, { "Key3", "Value3" } }; NonNullDictionary<String, String> target = new NonNullDictionary<String, String>(dictionary); String key = dictionary.Keys.First(); Boolean actual = target.Remove(key); Assert.AreEqual(true, actual); Assert.IsFalse(target.ContainsKey(key)); }
public void NonNullDictionary_Unit_ContainsKey_KeyDoesNotExist() { IDictionary<String, String> dictionary = new Dictionary<String, String>() { { "Key1", "Value1" }, { "Key2", "Value2" }, { "Key3", "Value3" } }; NonNullDictionary<String, String> target = new NonNullDictionary<String, String>(dictionary); String key = "MyKey"; Boolean actual = target.ContainsKey(key); Assert.AreEqual(false, actual); }