Ejemplo n.º 1
0
        public void UnitRdx_Reverse()
        {
            var rd = new RankedDictionary <int, int> {
                Capacity = 5
            };
            int expected = 500;

            for (int ii = 1; ii <= expected; ++ii)
            {
                rd.Add(ii, -ii);
            }

            foreach (var actual in rd.Reverse())
            {
                Assert.AreEqual(expected, actual.Key);
                Assert.AreEqual(-expected, actual.Value);
                --expected;
            }
            Assert.AreEqual(0, expected);
        }