public void TestVanillaICollectionReturned(KeyType[] keys, ValueType[] values) { SortedList <KeyType, ValueType> _dic = new SortedList <KeyType, ValueType>(); ValueType[] arrayToCheck = new ValueType[keys.Length]; for (int i = 0; i < keys.Length; i++) { arrayToCheck[i] = values[i]; _dic.Add(keys[i], values[i]); } Array.Sort(arrayToCheck); var tester = new ICollectionTester <ValueType>(); tester.RunTest(m_test, ((IDictionary)_dic).Values, keys.Length, false, ((IDictionary)_dic).SyncRoot, arrayToCheck); }
public void TestICollection(T[] items) { SortedList <int, T> _dictionary = BuildSortedList(items); KeyValuePair <int, T>[] arrayToCheck = new KeyValuePair <int, T> [items.Length]; ((ICollection <KeyValuePair <int, T> >)_dictionary).CopyTo(arrayToCheck, 0); #if ONLYZEROBOUND ICollectionTester <KeyValuePair <int, T> > .RunTest(_dictionary, items.Length, false, ((System.Collections.ICollection)_dictionary).SyncRoot, arrayToCheck, false, true); #else var tester = new ICollectionTester <KeyValuePair <int, T> >(); tester.RunTest(m_test, _dictionary, items.Length, false, ((System.Collections.ICollection)_dictionary).SyncRoot, arrayToCheck, false, false); #endif m_test.Eval(((System.Collections.ICollection)_dictionary).SyncRoot.GetType() == typeof(Object), "Err_47235fsd! Expected SyncRoot to be an object actual={0}", ((System.Collections.ICollection)_dictionary).SyncRoot.GetType()); }
public void EnumeratorTest(ICollectionTester tester) => tester.EnumeratorTest();
public void ClearTest(ICollectionTester tester) => tester.ClearTest();
public void RemoveTest(ICollectionTester tester) => tester.RemoveTest();
public void AddTest(ICollectionTester tester) => tester.AddTest();