コード例 #1
0
        public void Reset_AfterFirstIteration_MakesSourceIterableAgain()
        {
            ObjectDataSource<int> objds = new ObjectDataSource<int>(new int []{1,2,3,4,9});

            int count = 0;
            int count1 = 0;
            while( objds.MoveNext())
                count++;

            Assert.IsFalse(objds.MoveNext());

            objds.Reset();

            while( objds.MoveNext())
                count1++;

            Assert.AreEqual(count,count1);
        }
コード例 #2
0
        public void Reset_AfterFirstIteration_MakesSourceIterableAgain()
        {
            ObjectDataSource <int> objds = new ObjectDataSource <int>(new int [] { 1, 2, 3, 4, 9 });

            int count  = 0;
            int count1 = 0;

            while (objds.MoveNext())
            {
                count++;
            }

            Assert.IsFalse(objds.MoveNext());

            objds.Reset();

            while (objds.MoveNext())
            {
                count1++;
            }

            Assert.AreEqual(count, count1);
        }