public void ThemDichVu_TestStatusResponse() { var dich_vu = data_test.TaoMoiDichVu(); var action_result = controller.ThemDichVu(dich_vu); //act var actual_result1 = action_result as OkNegotiatedContentResult <string>; var actual_result2 = action_result as BadRequestErrorMessageResult; var expected_result1 = "Thêm dịch vụ thành công!"; var expected_result2 = "Thêm dịch vụ thất bại!"; //assert try { Assert.AreEqual(expected_result1, actual_result1.Content); } catch (System.Exception) { Assert.AreEqual(expected_result2, actual_result2.Message); } }