#Kata: Leap Year #
A leap year (or intercalary or bissextile year) is a year containing one additional day (or, in the case of lunisolar calendars, a month) in order to keep the calendar year synchronized with the astronomical or seasonal year.
A leap year is:
-
divisible by 4
-
not divisible by 100, unless it is also divisible by 400.
##Test Cases ##
LeapYear_returns_true_for_1904()
LeapYear_returns_true_for_1952()
LeapYear_returns_true_for_2000()
LeapYear_returns_true_for_2012()
LeapYear_returns_true_for_2048()
LeapYear_returns_true_for_2096()
LeapYear_returns_false_for_1700()
LeapYear_returns_false_for_1900()
LeapYear_returns_false_for_2100()
LeapYear_returns_false_for_2001()
LeapYear_returns_false_for_2014()
LeapYear_returns_false_for_2050()
B.C. and 1st Century A.D. Leap Years did not follow the pattern above. Extend your LeapYear.IsLeapYear(int)
method to correctly identify these Leap Years using the details below. Use negative numbers to indicate BCE years.
The leap year was introduced in the Julian calendar in 46 BC. However, around 10 BC, it was found that the priests in charge of computing the calendar had been adding leap years every three years instead of the four decreed by Caesar (Vardi 1991, p. 239). As a result of this error, no more leap years were added until 8 AD.
###Extra Credit Test Cases###
LeapYear_returns_false_for_4AD()
LeapYear_returns_false_for_0AD()
LeapYear_returns_false_for_50BC()
LeapYear_returns_true_for_8AD()
LeapYear_returns_true_for_30BC()
LeapYear_returns_true_for_45BC()