Exemple #1
0
        public void Should_return_20_years_when_year_is_1999()
        {
            LeapYearCalculator lyc = new LeapYearCalculator(1999);

            var years = lyc.Get20LeapYears();

            Assert.Equal(20, years.Count);
        }
Exemple #2
0
        private static void Main()
        {
            LeapYearCalculator leapYearCalculator = new LeapYearCalculator(2019);

            List <int> leapYears = leapYearCalculator.Get20LeapYears();

            foreach (var year in leapYears)
            {
                Console.WriteLine($"This is a leap year {year}");
            }
        }
Exemple #3
0
        public void Should_return_correct_years_when_year_is_1999()
        {
            LeapYearCalculator lyc = new LeapYearCalculator(1999);

            var years = lyc.Get20LeapYears();

            var testYears = new List <int> {
                2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064, 2068, 2072, 2076
            };

            Assert.Equal(testYears, years);
        }