public void WhenStartIsOne_AndDiffTwo_ThenReturnSequence(int size, int lastValue)
            {
                var result = Sequencer.Arithmetic(size, 1, 2);

                Assert.That(result.Count, Is.EqualTo(size));
                Assert.That(result.Last(), Is.EqualTo(lastValue));
            }
            public void WhenSizeIsZeroOrLess_ThenReturnEmpty(int size)
            {
                var result = Sequencer.Arithmetic(size, 1, 2);

                Assert.That(result, Is.Empty);
            }
Esempio n. 3
0
        public static IEnumerable <int> GetYears()
        {
            const int startYear = 1920;

            return(Sequencer.Arithmetic(DateTime.Now.Year - startYear + 1, startYear, 1));  // 1920 - 2021
        }