public void DateCalculatorVerifyFebuaryDaysPerMonth(int year, int expectedDays) { int month = 2; int days = DateCalculator.DaysPerMonth(month, year); Assert.AreEqual(expectedDays, days, "Verify that the days matches the expected value for month ", month); }
/// <summary> /// The method to determine the day number of the year for a day/month/year /// </summary> /// <param name="day">The day of the month to calculated.</param> /// <param name="month">The month to calculated.</param> /// <param name="year">The year to calculated.</param> /// <returns>The day number 1 Jan is day 1,</returns> internal static int DayNumber(int day, int month, int year) { int total = 0; if (DateCalculator.DateValid(day, month, year)) { for (int index = 1; index < month; index++) { total += DateCalculator.DaysPerMonth(index, year); } total += day; } return(total); }