public void testPreRegistrationMessageNotSent() { MessagingEngine engine = makeEngine(); engine.TimeNow = new DateTime(2021, 1, 1, 9, 0, 0); reset(); List <PmsAppointment> appts = new List <PmsAppointment>(); appts.Add(tomorrowsAppointment()); appts[0].ExternalData.PostRegistrationMessageSent = true; // run it engine.ProcessUpcomingAppointments(appts); // inspect outputs: Assert.AreEqual(0, OutputMsgs.Count, "Expected no messages to be sent"); Assert.AreEqual(0, StorageOps.Count, "Nothing should have been stored"); }
public void testPreRegistrationMessageNotSentForToday() { MessagingEngine engine = makeEngine(); engine.TimeNow = new DateTime(2021, 1, 1, 9, 0, 0); reset(); List <PmsAppointment> appts = new List <PmsAppointment>(); // set it up: appts.Add(appt10am()); // run it engine.ProcessUpcomingAppointments(appts); // inspect outputs: Assert.AreEqual(0, OutputMsgs.Count); Assert.AreEqual(0, StorageOps.Count); }
public void testPreRegistrationMessageSent() { MessagingEngine engine = makeEngine(); engine.TimeNow = new DateTime(2021, 1, 1, 9, 0, 0); reset(); List <PmsAppointment> appts = new List <PmsAppointment>(); // set it up: appts.Add(tomorrowsAppointment()); // run it engine.ProcessUpcomingAppointments(appts); // inspect outputs: Assert.AreEqual(1, OutputMsgs.Count); Assert.AreEqual("+0411012345", OutputMsgs[0].phone); Assert.AreEqual("Patient Test Patient #1 has an appointment with Dr Adam Ant at 09:15 AM on 2-Jan. 3 hours prior to the appointment, you will be sent a COVID-19 screening check to decide whether you should do a video consultation rather than seeing the doctor in person", OutputMsgs[0].message); Assert.AreEqual(1, StorageOps.Count); Assert.AreEqual("save-appt", StorageOps[0].type); Assert.AreEqual("1234", StorageOps[0].Appointment.AppointmentFhirID); Assert.IsTrue(StorageOps[0].Appointment.ExternalData.PostRegistrationMessageSent); }