public void GetPatient_ShouldReturnPatienttWithSameID() { var context = new TestPacmanRESTContext(); context.Pacman_patient_db.Add(GetDemoPatient()); var controller = new PatientController(context); var result = controller.GetPacman_patient_db(1) as OkNegotiatedContentResult<Pacman_patient_db>; Assert.IsNotNull(result); Assert.AreEqual(1, result.Content.ID); }
public void DeletePatient_ShouldReturnOK() { var context = new TestPacmanRESTContext(); var item = GetDemoPatient(); context.Pacman_patient_db.Add(item); var controller = new PatientController(context); var result = controller.DeletePacman_patient_db(3) as OkNegotiatedContentResult<Pacman_patient_db>; Assert.IsNotNull(result); //Assert.AreEqual(item.ID, result.Content.ID); }
public void GetPatient_ShouldReturnPatienttWithSameID() { var context = new TestPacmanRESTContext(); context.Pacman_patient_db.Add(GetDemoPatient()); var controller = new PatientController(context); var result = controller.GetPacman_patient_db(1) as OkNegotiatedContentResult <Pacman_patient_db>; Assert.IsNotNull(result); Assert.AreEqual(1, result.Content.ID); }
public void GetPatient_ShouldReturnAllPatients() { var context = new TestPacmanRESTContext(); context.Pacman_patient_db.Add(new Pacman_patient_db { ID = 1, device_id = "lotsofstringhere", name = "demoPatient", phone = "4321" }); context.Pacman_patient_db.Add(new Pacman_patient_db { ID = 2, device_id = "lotsofstringhere", name = "demoPatient", phone = "4321" }); context.Pacman_patient_db.Add(new Pacman_patient_db { ID = 3, device_id = "lotsofstringhere", name = "demoPatient", phone = "4321" }); var controller = new PatientController(context); var result = controller.GetPacman_patient_db() as TestPatientDbSet; Assert.IsNotNull(result); Assert.AreEqual(3, result.Local.Count); }
public void GetCarer_ShouldReturnAllPatients() { var context = new TestPacmanRESTContext(); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 1, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address="address", email = "*****@*****.**" }); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 2, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address="address", email = "*****@*****.**" }); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 3, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address="address", email = "*****@*****.**" }); var controller = new CarerController(context); var result = controller.GetPacman_carer_db() as TestPatientDbSet; Assert.IsNotNull(result); Assert.AreEqual(3, result.Local.Count); }
public void DeletePatient_ShouldReturnOK() { var context = new TestPacmanRESTContext(); var item = GetDemoPatient(); context.Pacman_patient_db.Add(item); var controller = new PatientController(context); var result = controller.DeletePacman_patient_db(3) as OkNegotiatedContentResult <Pacman_patient_db>; Assert.IsNotNull(result); //Assert.AreEqual(item.ID, result.Content.ID); }
public void GetCarer_ShouldReturnAllPatients() { var context = new TestPacmanRESTContext(); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 1, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address = "address", email = "*****@*****.**" }); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 2, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address = "address", email = "*****@*****.**" }); context.Pacman_carer_db.Add(new Pacman_carer_db { ID = 3, device_id = "lotsofstringhere", name = "demoPatient", phone = 4321, address = "address", email = "*****@*****.**" }); var controller = new CarerController(context); var result = controller.GetPacman_carer_db() as TestPatientDbSet; Assert.IsNotNull(result); Assert.AreEqual(3, result.Local.Count); }