Exemple #1
0
        public void LightDictionary_Generic_ContainsValue_NotPresent(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);
            int    seed       = 4315;
            TValue notPresent = CreateTValue(seed++);

            while (dictionary.Values.Contains(notPresent))
            {
                notPresent = CreateTValue(seed++);
            }
            Assert.False(dictionary.ContainsValue(notPresent));
        }
Exemple #2
0
        public void LightDictionary_Generic_ContainsValue_DefaultValuePresent(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);
            int  seed       = 4315;
            TKey notPresent = CreateTKey(seed++);

            while (dictionary.ContainsKey(notPresent))
            {
                notPresent = CreateTKey(seed++);
            }
            dictionary.Add(notPresent, default(TValue));
            Assert.True(dictionary.ContainsValue(default(TValue)));
        }
Exemple #3
0
        public void LightDictionary_Generic_ContainsValue_Present(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);
            int seed = 4315;
            KeyValuePair <TKey, TValue> notPresent = CreateT(seed++);

            while (dictionary.Contains(notPresent))
            {
                notPresent = CreateT(seed++);
            }
            dictionary.Add(notPresent.Key, notPresent.Value);
            Assert.True(dictionary.ContainsValue(notPresent.Value));
        }
Exemple #4
0
        public void LightDictionary_Generic_ContainsValue_DefaultValueNotPresent(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);

            Assert.False(dictionary.ContainsValue(default(TValue)));
        }