public async Task UpdateDctorInfoTest() { String updateURL = BaseURL + "/doctor/profile/info"; String getDoctorURL = BaseURL + "/doctor/profile/doctor"; var newDoctor = CreateNewDoctor(); var client = await AccountUtils.LoginUserAndGetClient(doctor1, Password); var payload = HttpUtils.CreateContent(newDoctor); var response = await client.PostAsync(updateURL, payload); Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK); var response1 = await LoginDoctorAndGetDetails(getDoctorURL, doctor1); Assert.IsTrue(response1.Contains("Sectia 2")); newDoctor.Ward = "Sectia 1"; payload = HttpUtils.CreateContent(newDoctor); response = await client.PostAsync(updateURL, payload); Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK); response1 = await LoginDoctorAndGetDetails(getDoctorURL, doctor1); Assert.IsTrue(response1.Contains("Sectia 1")); }
private async Task <HttpResponseMessage> LoginClientAndPerformGet(String donorName, String URL) { var client = await AccountUtils.LoginUserAndGetClient(donorName, Password); var response = await client.GetAsync(URL); Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK); return(response); }
private async Task <String> LoginDoctorAndGetDetails(String URL, String doctor) { var client = await AccountUtils.LoginUserAndGetClient(doctor, Password); var response = await client.GetAsync(URL); Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK); return(await response.Content.ReadAsStringAsync()); }
public async Task AddRequestTest() { var URL = BaseURL + "/doctors/addRequest"; var doctorRequest = new DoctorRequestViewModel { BloodType = "O1", Rh = "NEGATIV", EmergencyLevel = "RIDICAT", Component = "BloodBag" }; var payload = HttpUtils.CreateContent(doctorRequest); var client = await AccountUtils.LoginUserAndGetClient(doctor1, Password); var response = await client.PostAsync(URL, payload); Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK); }