Пример #1
0
        public void BaseGenerator_Generate_Output()
        {
            int expected  = 0;
            var generator = new NumberGeneratorStart0Increment1();
            int actual    = generator.Generate();

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void BaseGenerator_Generate_Properties()
        {
            int expected  = 0;
            var generator = new NumberGeneratorStart0Increment1();

            generator.Generate();

            Assert.Equal(expected, generator.Current);
            Assert.Equal(1, generator.Count);
        }
Пример #3
0
        public void BaseGenerator_GenerateMultiple_Properties()
        {
            int iterations = 5;
            var generator  = new NumberGeneratorStart0Increment1();

            for (int i = 0; i < iterations; i++)
            {
                generator.Generate();
            }

            Assert.Equal(iterations - 1, generator.Current);
            Assert.Equal(iterations - 2, generator.Previous);
            Assert.Equal(iterations, generator.Count);
        }