System.Collections.Tests.SortedListTests.GetValueList_CopyTo_Invalid C# (CSharp) Méthode

GetValueList_CopyTo_Invalid() private méthode

private GetValueList_CopyTo_Invalid ( ) : void
Résultat void
        public static void GetValueList_CopyTo_Invalid()
        {
            SortedList sortList1 = Helpers.CreateIntSortedList(100);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                IList values = sortList2.GetValueList();
                Assert.Throws<ArgumentNullException>("dest", () => values.CopyTo(null, 0)); // Array is null
                Assert.Throws<ArgumentException>(() => values.CopyTo(new object[10, 10], 0)); // Array is multidimensional

                Assert.Throws<ArgumentOutOfRangeException>("dstIndex", () => values.CopyTo(new object[100], -1)); // Index < 0
                Assert.Throws<ArgumentException>(string.Empty, () => values.CopyTo(new object[150], 51)); // Index + list.Count > array.Count
            });
        }
SortedListTests