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

GetByIndex_InvalidIndex_ThrowsArgumentOutOfRangeException() private méthode

        public static void GetByIndex_InvalidIndex_ThrowsArgumentOutOfRangeException()
        {
            SortedList sortList1 = Helpers.CreateIntSortedList(100);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                Assert.Throws<ArgumentOutOfRangeException>("index", () => sortList2.GetByIndex(-1)); // Index < 0
                Assert.Throws<ArgumentOutOfRangeException>("index", () => sortList2.GetByIndex(sortList2.Count)); // Index >= list.Count
            });
        }
SortedListTests