I have an Action that gets JSON data from Request.Form[0] and has calls into domain objects.
I am testing this method, but it seems impossible to set Request.Form.
I could extract the method to another that takes the string it returns, but that would just be a one line method and the Action would still be untested.
Is there a method to test this or another, more testable method to get the JSON data from a $.ajax() call?
It's possible to pass a strongly typed
stringparameter writing it into the method, by adding it as a parameterpublic JsonResult ActionName(string paramName)and including it in the data: