示例#1
0
        public void NonNullDictionary_Unit_ContainsValue_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 value = dictionary[dictionary.Keys.First()];

            Boolean actual = target.ContainsValue(value);
            Assert.AreEqual(true, actual);
        }
示例#2
0
        public void NonNullDictionary_Unit_ContainsValue_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 value = null;

            Boolean actual = target.ContainsValue(value);
            Assert.AreEqual(false, actual);
        }