Dear friends,
We can return jsonResult via invoking the Josn() method in the controller, in general, I will pass one anonymous object such as Josn(new {isSuccess = true, message="It's success!"});
var actionResult = controller.JosnMethod() as JsonResult;
Assert.AreEqual("{ isSuccess = True, message = ="It's success!" }", result.Data.ToString(), true);
Now I wanna find one best practices to test the JosnResult, it's a json string. It's possible very long, comparing the string is not a good idea. Any help?