Esempio n. 1
0
        public void IndexedCollection_EnumeratorGeneric()
        {
            int count      = 10;
            var collection = new IndexedCollection <int, TestObject>(t => t.Sequence);

            collection.AddRange(_objects.GetRange(0, count));

            IEnumerator <TestObject> enumerator = collection.GetEnumerator();

            Assert.IsNotNull(enumerator);

            int iterations = 0;

            while (enumerator.MoveNext())
            {
                var obj = enumerator.Current;
                ++iterations;
            }
            Assert.AreEqual(count, iterations);
        }