public void TestAddTestSuccess() { // Arrange MedicalController _controller = new MedicalController(); bool expected = true; // Act bool actual = _controller.AddTest(1, 1, "13/12/2013", 0, "test"); // Assert Assert.AreEqual(expected, actual); }
public void TestAddTestFail() { // Arrange MedicalController _controller = new MedicalController(); bool expected = false; // Act bool actual = _controller.AddTest(1, 1, "12-12-2013", 0, "test"); // Assert Assert.AreEqual(expected, actual); }
public FormMedical() { InitializeComponent(); _medicalController = new MedicalController(); _staff = UserSession.Instance().CurrentUser; _medicines = new List<Medicine>(); FormRefreshCalendar(); // Shows the currently logged in user's name in the status bar. loggedInLabel.Text = "Logged In As: " + UserSession.Instance().CurrentUser.ToString(); testTypeCmb.DataSource = Enum.GetValues(typeof(TestType)); }
public void TestAddPrescriptionSuccess() { // Arrange MedicalController _controller = new MedicalController(); List<Medicine> _medicines = new List<Medicine>(); _medicines.Add(new Medicine()); _medicines[0].MedicineID = 1; _medicines[0].MedicineName = "Thyroxine"; _medicines[0].Dosage = "125mg"; bool expected = true; // Act bool actual = _controller.AddPrescription(1, 1, "10-10-2013", "04-01-2014", _medicines); // Assert Assert.AreEqual(expected, actual); }
public void TestSaveAppointmentNotesFail() { // Arrange MedicalController mc = new MedicalController(); bool expected = false; Appointment app = new Appointment(); app.AppointmentID = 1; app.PatientID = 10; app.StaffID = 2; app.StartDate = new DateTime(2000, 1, 1, 9, 0, 0); app.EndDate = new DateTime(2000, 1, 1, 9, 15, 0); // Act bool actual = mc.SaveAppointmentNotes(app, "test"); // Assert Assert.AreEqual(expected, actual); }
public void TestGetPatientTests() { // Arrange MedicalController controller = new MedicalController(); Patient patient = new Patient(); patient.Tests = new List<Test>(); patient.Tests.Add(new Test()); patient.Tests[0].StaffID = 1; patient.Tests[0].PatientID = 1; patient.Tests[0].TestDate = new DateTime(2013,12,12); patient.Tests[0].TestType = TestType.BloodTest; patient.Tests[0].TestResult = "test"; // Act Patient actualPatient = new Patient(); actualPatient.Tests = controller.GetPatientTests(1); // Assert CollectionAssert.AreEqual(patient.Prescriptions, actualPatient.Prescriptions); }
public void TestGetPatientPrescriptions() { // Arrange MedicalController controller = new MedicalController(); Patient patient = new Patient(); patient.Prescriptions = new List<Prescription>(); patient.Prescriptions.Add(new Prescription()); patient.Prescriptions[0].PrescriptionID = 1; patient.Prescriptions[0].PatientID = 1; patient.Prescriptions[0].StaffID = 1; patient.Prescriptions[0].StartDate = new DateTime(2013, 10, 12); patient.Prescriptions[0].EndDate = new DateTime(2014, 1, 1); patient.Prescriptions[0].Extended = false; patient.Prescriptions[0].Medicines.Add(new Medicine()); patient.Prescriptions[0].Medicines[0].MedicineID = 1; patient.Prescriptions[0].Medicines[0].MedicineName = "Thyroxine"; patient.Prescriptions[0].Medicines[0].Dosage = "125mg"; patient.Prescriptions[0].Medicines[0].Extendable = false; patient.Prescriptions.Add(new Prescription()); patient.Prescriptions[1].PrescriptionID = 2; patient.Prescriptions[1].PatientID = 1; patient.Prescriptions[1].StaffID = 1; patient.Prescriptions[1].StartDate = new DateTime(2013, 01, 01); patient.Prescriptions[1].EndDate = new DateTime(2013, 02, 01); patient.Prescriptions[1].Extended = false; patient.Prescriptions[1].Medicines.Add(new Medicine()); patient.Prescriptions[1].Medicines[0].MedicineID = 2; patient.Prescriptions[1].Medicines[0].MedicineName = "Thyroxine"; patient.Prescriptions[1].Medicines[0].Dosage = "50mg"; patient.Prescriptions[1].Medicines[0].Extendable = true; // Act Patient expectedPatient = new Patient(); expectedPatient.Prescriptions = controller.GetPatientPrescriptions(1); // Assert CollectionAssert.AreEqual(patient.Prescriptions, expectedPatient.Prescriptions); }