public void TestCareForPatient() { Patient patient = new Patient(); Doctor doctor = new Doctor("John", 12342, "Brain"); doctor.CareForPatient(patient); Assert.Equal(11, patient.health); }
public void Doctor_Can_Care_For_Patient() { //arrange //act doctor.CareForPatient(patient); //assert Assert.Equal(20, patient.HealthLevel); }
public void Does_CareForPatient_Increase_Patient_HealthStatus_By_15() { //arrange Doctor myDoctor = new Doctor(); Patient myPatient = new Patient(); myPatient.HealthStatus = 20; //act myDoctor.CareForPatient(myPatient); //assert Assert.Equal(35, myPatient.HealthStatus); }
public void CareForPatient_Does_Health_Level_Increase_by_10() { //Arrange Doctor firstDoctor = new Doctor(1, "Rob"); Patient myPatient = new Patient(1, "Sam"); //Act var currentHealth = myPatient.HealthStatus; firstDoctor.CareForPatient(myPatient); //Assert Assert.Equal(currentHealth + 10, myPatient.HealthStatus); }
public void CareForPatient_Health_Goes_Up() { //Arrange var myDoctor = new Doctor(); var newPatient = new Patient(); var currentHealth = newPatient.HealthStatus; newPatient.HealthStatus = 10; // Act myDoctor.CareForPatient(newPatient); // Assert Assert.Equal(currentHealth + 2, newPatient.HealthStatus); }
static void Main(string[] args) { Doctor doctor = new Doctor(); Nurse nurse = new Nurse(); Receptionist receptionist = new Receptionist(); Janitor janitor = new Janitor(); Patient patient = new Patient(); bool inMenu = true; Console.WriteLine("*********************************************\n\n"); Console.WriteLine("Welcome to the University Hospital Database"); Console.WriteLine("\n\n********************************************\n\n"); do { Console.WriteLine("Type any letter and press enter to open the database, or enter 0 to exit"); string menuOneInput = Console.ReadLine(); if (menuOneInput == "0") { Environment.Exit(0); } else { inMenu = false; Console.Clear(); } } while (inMenu); bool inMenuTwo = true; while (inMenuTwo) { Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Our Doctor : " + doctor.Name); Console.WriteLine("Specialty Area : " + doctor.Specialty); Console.WriteLine("Salary : " + doctor.Salary); Console.WriteLine("ID : " + doctor.EmpNum); Console.WriteLine("Pay Status : " + doctor.PayStat); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Our Nurse : " + nurse.Name); Console.WriteLine("Number of Patients : 1"); Console.WriteLine("Salary : " + nurse.Salary); Console.WriteLine("ID : " + nurse.EmpNum); Console.WriteLine("Pay Status : " + nurse.PayStat); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Our Receptionist : " + receptionist.Name); Console.WriteLine("Salary : " + receptionist.Salary); Console.WriteLine("ID : " + receptionist.EmpNum); Console.WriteLine("Pay Status : " + receptionist.PayStat); Console.WriteLine("On the phone : " + receptionist.OnPhone); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Our Janitor : " + janitor.Name); Console.WriteLine("Salary : " + janitor.Salary); Console.WriteLine("ID : " + janitor.EmpNum); Console.WriteLine("Pay Status : " + janitor.PayStat); Console.WriteLine("Sweeping : " + janitor.IsSweeping); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Enter the ID of the employee you'd like to interact with"); Console.WriteLine("Enter 0 to exit the database"); string menuTwoChoice = Console.ReadLine(); switch (menuTwoChoice) { case "45654": { Console.WriteLine("You've selected the Doctor"); Console.WriteLine("\n Options : "); Console.WriteLine("1. Pay doctor"); Console.WriteLine("2. Draw blood from patient"); Console.WriteLine("3. Care for patient"); string thirdMenuChoiceD = Console.ReadLine(); if (thirdMenuChoiceD == "1") { doctor.PaySalary(); } else if (thirdMenuChoiceD == "2") { doctor.DrawBlood(patient); } else if (thirdMenuChoiceD == "3") { doctor.CareForPatient(patient); } else { } } break; case "353654": { Console.WriteLine("You've selected the Nurse"); Console.WriteLine("\n Options : "); Console.WriteLine("1. Pay nurse"); Console.WriteLine("2. Draw blood from patient"); string thirdMenuChoiceN = Console.ReadLine(); if (thirdMenuChoiceN == "1") { nurse.PaySalary(); } else if (thirdMenuChoiceN == "2") { nurse.DrawBlood(patient); } else { } } break; case "765654": { Console.WriteLine("You've selected the Receptionist"); Console.WriteLine("\n Options : "); Console.WriteLine("1. Pay receptionist"); Console.WriteLine("2. Have the receptionist make a phone call"); string thirdMenuChoiceR = Console.ReadLine(); if (thirdMenuChoiceR == "1") { receptionist.PaySalary(); } else if (thirdMenuChoiceR == "2") { receptionist.Phone(); } else { } } break; case "545654": { Console.WriteLine("You've selected the Janitor"); Console.WriteLine("\n Options : "); Console.WriteLine("1. Pay janitor"); Console.WriteLine("2. Have the janitor sweep the floor"); string thirdMenuChoiceR = Console.ReadLine(); if (thirdMenuChoiceR == "1") { janitor.PaySalary(); } else if (thirdMenuChoiceR == "2") { janitor.Sweep(); } else { } } break; case "0": { Environment.Exit(0); } break; } } }