public void TestBirthdayValidator_CorrectlyValue() { var date = new DateTime(2000, 12, 12); Assert.DoesNotThrow(() => { DateValidator.AssertDate(date); }, "Incorrect date values"); }
public void TestBirthdayValidator_ArgumentException(int year, int month, int day, string message) { var date = new DateTime(year, month, day); Assert.Throws <ArgumentException>(() => { DateValidator.AssertDate(date); }, message); }
private void BirthdayDateTimePicker_ValueChanged(object sender, EventArgs e) { try { DateValidator.AssertDate(BirthdayDateTimePicker.Value); BirthdayDateTimePicker.CalendarTitleBackColor = Color.White; } catch (ArgumentException) { BirthdayDateTimePicker.CalendarTitleBackColor = Color.LightSalmon; } }