private GetByIndex_InvalidIndex_ThrowsArgumentOutOfRangeException ( ) : void | ||
Résultat | void |
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
});
}