Testing a controller action returning a JsonResult shouldn't be any different of testing other actions. Consider the following scenario:
public class MyModel
{
public string Name { get; set; }
}
public class HomeController : Controller
{
public ActionResult Index()
{
return Json(new MyModel { Name = "Hello World" });
}
}
And the unit test (sorry it's MSTest, I don't have NUnit atm but it should be pretty strait forward):
// arrange
var sut = new HomeController();
// act
var actual = sut.Index();
// assert
Assert.IsInstanceOfType(actual, typeof(JsonResult));
var jsonResult = (JsonResult)actual;
Assert.IsInstanceOfType(jsonResult.Data, typeof(MyModel));
var model = (MyModel)jsonResult.Data;
Assert.AreEqual("Hello World", model.Name);