public void RemoveAnnuallyBoldedDateTest () { MonthCalendar myMonthCal = new MonthCalendar (); DateTime[] dts = new DateTime [10]; dts[0] = new DateTime (2001, 02, 03, 04, 05, 06, 07); // base datetime dts[1] = new DateTime (2001, 02, 03); // only date dts[2] = new DateTime (2002, 03, 04); // only date, different dts[3] = new DateTime (2002, 02, 03, 04, 05, 06, 07); // different year dts[4] = new DateTime (2001, 03, 03, 04, 05, 06, 07); // different month dts[5] = new DateTime (2001, 02, 04, 04, 05, 06, 07); // etc... dts[6] = new DateTime (2001, 02, 03, 05, 05, 06, 07); dts[7] = new DateTime (2001, 02, 03, 04, 06, 06, 07); dts[8] = new DateTime (2001, 02, 03, 04, 05, 07, 07); dts[9] = new DateTime (2001, 02, 03, 04, 05, 06, 08); for (int i = 0; i < dts.Length; i++) { for (int j = 0; j < dts.Length; j++) { myMonthCal.RemoveAllAnnuallyBoldedDates (); myMonthCal.AddAnnuallyBoldedDate (dts [j]); myMonthCal.RemoveAnnuallyBoldedDate (dts [i]); if (dts [j].Month == dts [i].Month && dts [j].Day == dts [i].Day) Assert.AreEqual (0, myMonthCal.AnnuallyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ()); else Assert.AreEqual (1, myMonthCal.AnnuallyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ()); } } for (int i = 0; i < dts.Length; i++) { myMonthCal.AnnuallyBoldedDates = dts; myMonthCal.RemoveAnnuallyBoldedDate (dts [i]); Assert.AreEqual (9, myMonthCal.AnnuallyBoldedDates.Length, "#remove1" + i.ToString ()); } }