public void TestOnDateBefore() { // Arrange DateTime appStart = new DateTime(DateTime.Now.Year + 1, 1, 1, 0, 0, 0); // Create dummy appointments Appointments testApp = new Appointments {new Appointment() {Start = appStart}}; // Act List<Appointment> ocurringApps = testApp.GetAppointmentsOnDate(appStart.AddDays(-1)).Cast<Appointment>().ToList(); // Assert Assert.AreEqual(0, ocurringApps.Count, "There are appointments! There shouldn't be!"); }
public void TestOnDate() { // Arrange DateTime appStart = new DateTime(DateTime.Now.Year + 1, 1, 1, 0, 0, 0); // Create dummy appointments Appointments testApp = new Appointments {new Appointment() {Start = appStart}}; // Act List<Appointment> ocurringApps = testApp.GetAppointmentsOnDate(appStart).Cast<Appointment>().ToList(); // Assert Assert.AreEqual(1, ocurringApps.Count, "The appointment didn't ocurr on this date! It should!"); }