System.Collections.Tests.SortedListTests.Add_Invalid C# (CSharp) Method

Add_Invalid() private method

private Add_Invalid ( ) : void
return void
        public static void Add_Invalid()
        {
            SortedList sortList1 = Helpers.CreateIntSortedList(100);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                Assert.Throws<ArgumentNullException>("key", () => sortList2.Add(null, 101)); // Key is null

                Assert.Throws<ArgumentException>(null, () => sortList2.Add(1, 101)); // Key already exists
            });
        }
SortedListTests