public async Task<IHttpActionResult> PutPatient(PatientCreation newPatient) { if (!ModelState.IsValid) { return BadRequest(ModelState); } try { Do.putPatient(newPatient); } catch (DbUpdateConcurrencyException) { throw; } return StatusCode(HttpStatusCode.NoContent); }
public void PutAndDeletePatient() { using (ArchiViteContext context = new ArchiViteContext()) { _doc = new DocumentManager(context); User userTest = new User() { FirstName = "TEST", LastName = "TEST", Birthdate = DateTime.Now, Adress = "72 avenue maurice thorez", City = "Ivry-sur-Seine", Postcode = 12345, PhoneNumber = 0606066606, Pseudo = "test", Password = "******", Photo = "yolo" }; PatientCreation newPatient = new PatientCreation(userTest); _patientService.putPatient(newPatient); Assert.IsNotNull(context.SelectRequest.SelectPatient("test", "mdp")); _patientService.deletePatientCheck(context.SelectRequest.SelectPatient("test", "mdp").PatientId); Assert.IsNull(context.SelectRequest.SelectPatient("test", "mdp")); } }