I have a method which is returning Json Result Like :
return Json(new { status = "error", message = "The organization cannot be deleted because contains transmitters!" });
Now I want to test with status and Message I have tried with this
var result = Controller.DeleteOrganization(2) as JsonResult;
Assert.AreEqual("error", result.Data.message);
I am getting Error:
object does not contain a definition for message
How can I resolve this Issue?