예제 #1
0
        private static void numbersIteratorTest()
        {
            NumbersIterator numbersIterator = new NumbersIterator(3, 5);
            int             count           = 1;

            while (numbersIterator.MoveNext())
            {
                String word = String.Join("", numbersIterator.Current);
                Console.WriteLine(count + "\t" + word);
                count++;
            }
        }
        public void Current_10Nums_AllNumsIsSimple()
        {
            var expected = new List <int>()
            {
                1, 2, 3, 5, 7, 11, 13, 17, 19, 23
            };
            var iterator = new NumbersIterator();

            foreach (var item in expected)
            {
                iterator.MoveNext();
                Assert.AreEqual(item, iterator.Current);
            }
        }