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

GetKeyList() private méthode

private GetKeyList ( int count ) : void
count int
Résultat void
        public static void GetKeyList(int count)
        {
            SortedList sortList1 = Helpers.CreateStringSortedList(count);
            Helpers.PerformActionOnAllSortedListWrappers(sortList1, sortList2 =>
            {
                IList keys1 = sortList2.GetKeyList();
                IList keys2 = sortList2.GetKeyList();
                
                // Test we have copied the correct keys
                Assert.Equal(count, keys1.Count);
                Assert.Equal(count, keys2.Count);

                for (int i = 0; i < keys1.Count; i++)
                {
                    string key = "Key_" + i.ToString("D2");
                    Assert.Equal(key, keys1[i]);
                    Assert.Equal(key, keys2[i]);

                    Assert.True(sortList2.ContainsKey(keys1[i]));
                }
            });
        }
SortedListTests