public void Test1() { /* * How many Sundays fell on the first of the month 1901/1902 */ var sut = new E019CountingSundays(); var fromDate = new DateTime(1901, 1, 1); var toDate = new DateTime(1902, 12, 31); int sundaysExpected = 3; int sundays = sut.CountingSundays(fromDate: fromDate, toDate: toDate); Assert.Equal(sundaysExpected, sundays); }
public void Solution() { /* * How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)? */ var sut = new E019CountingSundays(); var fromDate = new DateTime(1901, 1, 1); var toDate = new DateTime(2000, 12, 31); int sundaysExpected = 171; int sundays = sut.CountingSundays(fromDate: fromDate, toDate: toDate); Assert.Equal(sundaysExpected, sundays); /* * Congratulations, the answer you gave to problem 19 is correct. * * You are the 119283rd person to have solved this problem. */ }