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

GetKeyList_IndexOf_Invalid() private méthode

private GetKeyList_IndexOf_Invalid ( ) : void
Résultat void
        public static void GetKeyList_IndexOf_Invalid()
        {
            SortedList sortList1 = Helpers.CreateIntSortedList(100);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                IList keys = sortList2.GetKeyList();
                Assert.Throws<ArgumentNullException>("key", () => keys.IndexOf(null)); // Value is null
                Assert.Throws<InvalidOperationException>(() => keys.IndexOf("hello")); // Value is a different object type
            });
        }
SortedListTests