public bool VerifyICollection_T(GenerateItem <KeyType> keyGenerator, GenerateItem <ValueType> valueGenerator, int numItems) { Dictionary <KeyType, ValueType> d = new Dictionary <KeyType, ValueType>(); KeyType[] keys = new KeyType[numItems]; ICollection_T_Test <KeyType> iCollectionTest; bool retValue = true; for (int i = 0; i < numItems; ++i) { keys[i] = keyGenerator(); d.Add(keys[i], valueGenerator()); } iCollectionTest = new ICollection_T_Test <KeyType>(m_test, d.Keys, keyGenerator, keys, true); iCollectionTest.ItemsMustBeUnique = true; iCollectionTest.ItemsMustBeNonNull = default(KeyType) == null; iCollectionTest.CollectionOrder = TestSupport.CollectionOrder.Unspecified; retValue &= m_test.Eval(iCollectionTest.RunAllTests(), "Err_98382apeuie System.Collections.Generic.ICollection<KeyType> tests FAILED"); return(retValue); }
public bool Verify(GenerateItem <K> keyGenerator, GenerateItem <V> valueGenerator) { SortedList <K, V> d = new SortedList <K, V>(); KeyValuePairGenerator <K, V> keyValuePairGenerator = new KeyValuePairGenerator <K, V>(keyGenerator, valueGenerator); ICollection_T_Test <KeyValuePair <K, V> > iCollectionTest = new ICollection_T_Test <KeyValuePair <K, V> >(m_test, d, new GenerateItem <KeyValuePair <K, V> >(keyValuePairGenerator.Generate), null, false); bool retValue = true; iCollectionTest.ItemsMustBeUnique = true; iCollectionTest.ItemsMustBeNonNull = default(K) == null; iCollectionTest.CollectionOrder = TestSupport.CollectionOrder.Unspecified; iCollectionTest.Converter = ConverterHelper.DictionaryEntryToKeyValuePairConverter <K, V>; retValue &= m_test.Eval(iCollectionTest.RunAllTests(), "Err_98382apeuie System.Collections.Generic.ICollection<KeyValuePair<K, V>> tests FAILED"); return(retValue); }