开发者

Unit Testing ASP.Net MVC Action result with call to Server.UrlDecode

开发者 https://www.devze.com 2022-12-17 01:09 出处:网络
We are trying to write Unit 开发者_如何学PythonTests in our ASP.Net MVC project. Some of the methods in the controller contain a call to Server.UrlDecode

We are trying to write Unit 开发者_如何学PythonTests in our ASP.Net MVC project.

Some of the methods in the controller contain a call to Server.UrlDecode

This fails with a null reference exception when called from a unit test.

Anybody have a solution for this?


Use the static HttpUtility class and its UrlDecode method.

HttpUtility.UrlDecode(mystring);
0

精彩评论

暂无评论...
验证码 换一张
取 消