Exemplo n.º 1
0
        public void TestStreamCollection_Modifying()
        {
            LinkedList <string> list = new LinkedList <string>();

            for (int i = 0; i < 10; i++)
            {
                list.AddLast(i.ToString());
            }
            var sc = new StreamCollection <string>(0, list);

            var enumerator = sc.GetEnumerator();
            int j          = 0;

            for (int i = 0; i < 5; i++)
            {
                enumerator.MoveNext();
                Assert.AreEqual(j++.ToString(), enumerator.Current);
            }
            list.AddLast("10");
            enumerator.MoveNext();
            Assert.AreEqual(j++.ToString(), enumerator.Current);
        }