public void TestCopyTo() { var dict = new BinaryTreeDictionary <int, string>(); dict.Add(1, "first value"); dict.Add(3, "third value"); dict.Add(7, "seventh value"); dict.Add(11, "eleventh value"); KeyValuePair <int, string>[] array = new KeyValuePair <int, string> [4]; dict.CopyTo(array, 0); Assert.IsNotNull(array); Assert.AreEqual(array[0], new KeyValuePair <int, string>(1, "first value")); }
public void TestCopyTo() { var dictionary = new BinaryTreeDictionary <int, string>(); dictionary.Add(8, "eight"); dictionary.Add(3, "three"); dictionary.Add(10, "ten"); dictionary.Add(6, "six"); dictionary.Add(1, "one"); dictionary.Add(14, "fourteen"); dictionary.Add(4, "four"); dictionary.Add(7, "seven"); KeyValuePair <int, string>[] array = new KeyValuePair <int, string> [8]; dictionary.CopyTo(array, 0); Assert.IsNotNull(array);; Assert.AreEqual(array[0], new KeyValuePair <int, string>(1, "one"));; }