Exemple #1
0
        public void CheckIfCopyToExceptionsWorkCorrectly2()
        {
            var hashList = new DataStructures.HashingListDictionary <string, string>(10);

            hashList.Add("1", "Ana");
            KeyValuePair <string, string>[] array = new KeyValuePair <string, string> [20];
            Assert.Throws <ArgumentOutOfRangeException>(() => hashList.CopyTo(array, -1));
        }
Exemple #2
0
        public void CheckIfCopyToWorksCorrectly()
        {
            var hashList = new DataStructures.HashingListDictionary <int, string>(10);

            hashList.Add(1, "Ana");
            hashList.Add(11, "Andrei");
            KeyValuePair <int, string>[] array1 = { new KeyValuePair <int, string>(1, "Ana"), new KeyValuePair <int, string>(11, "Andrei") };
            KeyValuePair <int, string>[] array2 = new KeyValuePair <int, string> [2];
            hashList.CopyTo(array2, 0);
            Assert.Equal(array1, array2);
        }