private void btXoa_Click(object sender, EventArgs e) { if (statuss != Status.isEdit) { statuss = Status.isEdit; status = Status.isEdit; MessageBox.Show("Chế độ sửa"); } else { quanLyPhong.XoaPhong(row); } }
public void XoaPhong_TestStatusResponse() { var action_result = controller.XoaPhong(7); //act var actual_result1 = action_result as OkNegotiatedContentResult <string>; var actual_result2 = action_result as BadRequestErrorMessageResult; var expected_result1 = "Xóa phòng thành công!"; var expected_result2 = "Xóa phòng thất bại!"; //assert try { Assert.AreEqual(expected_result1, actual_result1.Content); } catch (System.Exception) { Assert.AreEqual(expected_result2, actual_result2.Message); } }