public void IDictionary_NonGeneric_Contains_KeyOfWrongType()
 {
     if (!IsReadOnly)
     {
         IDictionary dictionary = new LinkedDictionary <string, int>();
         Assert.False(dictionary.Contains(1));
     }
 }
        public void LinkedDictionary_Generic_ContainsValue_Present(int count)
        {
            LinkedDictionary <TKey, TValue> dictionary = (LinkedDictionary <TKey, TValue>)GenericIDictionaryFactory(count);
            int seed = 4315;

            SCG.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));
        }
Ejemplo n.º 3
0
 /// <summary>Tests if these attributes contain an attribute with this key.</summary>
 /// <param name="key">key to check for</param>
 /// <returns>true if key exists, false otherwise</returns>
 public virtual bool HasKey(String key)
 {
     return(attributes != null && attributes.Contains(key.ToLowerInvariant()));
 }
 public void AddTest()
 {
     Dictionary.Add(40, "Billy");
     Assert.True(Dictionary.Contains(40));
 }