public void CapNhatTaiKhoan_TestStatusResponse() { Data_Test data_Test = new Data_Test(); var newAccount = data_Test.TaiKhoan(); // Act IHttpActionResult actionResult = controller.CapNhatTaiKhoan(newAccount); var actual_result = actionResult as OkNegotiatedContentResult <string>; // Assert try { Assert.AreEqual("Cập nhật tài khoản thành công!", actual_result.Content); } catch (System.Exception) { Assert.IsNotNull(actual_result.Content); } }
public void ThemTaiKhoan_TestStatusResponse() { var newAccount = data_test.TaiKhoan(); // Act IHttpActionResult actionResult = controller.ThemTaiKhoan(newAccount); var actual_result = actionResult as NegotiatedContentResult <string>; // Assert try { Assert.AreEqual("Thêm tài khoản thành công!", actual_result.Content); } catch (System.Exception) { var actual_result2 = actionResult as BadRequestErrorMessageResult; Assert.AreEqual("Thêm tài khoản thất bại!", actual_result2.Message); } }