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

GetEnumerator_IDictionaryEnumerator() private method

private GetEnumerator_IDictionaryEnumerator ( int count ) : void
count int
return void
        public static void GetEnumerator_IDictionaryEnumerator(int count)
        {
            SortedList sortList1 = Helpers.CreateIntSortedList(count);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                Assert.NotSame(sortList2.GetEnumerator(), sortList2.GetEnumerator());
                IDictionaryEnumerator enumerator = sortList2.GetEnumerator();
                for (int i = 0; i < 2; i++)
                {
                    int counter = 0;
                    while (enumerator.MoveNext())
                    {
                        Assert.Equal(enumerator.Current, enumerator.Entry);
                        Assert.Equal(enumerator.Entry.Key, enumerator.Key);
                        Assert.Equal(enumerator.Entry.Value, enumerator.Value);

                        Assert.Equal(sortList2.GetKey(counter), enumerator.Entry.Key);
                        Assert.Equal(sortList2.GetByIndex(counter), enumerator.Entry.Value);

                        counter++;
                    }
                    Assert.Equal(count, counter);
                    enumerator.Reset();
                }
            });
        }
SortedListTests