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

GetKey_InvalidIndex_ThrowsArgumentOutOfRangeException() private méthode

private GetKey_InvalidIndex_ThrowsArgumentOutOfRangeException ( ) : void
Résultat void
        public static void GetKey_InvalidIndex_ThrowsArgumentOutOfRangeException()
        {
            SortedList sortList1 = Helpers.CreateStringSortedList(100);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                Assert.Throws<ArgumentOutOfRangeException>("index", () => sortList2.GetKey(-1)); // Index < 0
                Assert.Throws<ArgumentOutOfRangeException>("index", () => sortList2.GetKey(sortList2.Count)); // Index >= count
            });
        }
SortedListTests