阅读背景:

如何测试序列化视图的控制器操作

来源:互联网 

Alright so I am trying to test a controller result to make sure it is returning the right values but I am running into a number of problems with mocking controller contexts. All I want to do is test if someone enters a number on a page if the JsonResult is success = true. However in the controller I serialize a partial view and return some HTML that contains all the data that is pertinent to the request number. I am comfortable with setting up the expected results in the json result, but I can't even get the test to advance to that far. The test gets hung up when serializing the partial view. I don't really care to test that but I don't know how to work around the result of that function other than the create some fakes for the controllercontext and let it search for an serialize the view.Alright so I am trying to test a controller res




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: