/// <summary> /// Update the incident's description to what the user has entered /// </summary> private void Update_Button_Clicked(object sender, EventArgs e) { string uid = label_UID.Text; Console.WriteLine("UID = " + uid); Incidents.Update_Incident(uid, originalDescription, IncidentDescriber_TextBox.Text); // Repopulate the list, so the new description is can be seen Populate_User_Search_List(); }
public void Staff_should_update_incident_details() { // First add a sample incident to the database. string theIncident = "Resident refused to take their medicine"; // User ID is 5 Incidents.Add_Incident("5", theIncident); // Change the description string updatedDesc = "Resident refused to take their medicine, SuperDrug. They became aggressive" + " when confronted by staff"; // Update the entry Incidents.Update_Incident("5", theIncident, updatedDesc); string[] columnNames = { "UID", "IncidentDescription" }; string[] columnExpectedValues = { "5", updatedDesc }; // Test passes if the entry has changed Assert.IsTrue(_mysql.DataDoesExist("Incidents", columnNames, columnExpectedValues)); // Delete once done _mysql.Delete_Entries("5", "Incidents", columnNames, columnExpectedValues); }