【问题标题】:Unit Testing ASP.Net MVC Action result with call to Server.UrlDecode单元测试 ASP.Net MVC 操作结果,调用 Server.UrlDecode
【发布时间】:2010-01-22 15:09:12
【问题描述】:

我们正在尝试在我们的 ASP.Net MVC 项目中编写单元测试。

控制器中的某些方法包含对 Server.UrlDecode 的调用

当从单元测试中调用时,这会失败并出现空引用异常。

有人有解决办法吗?

【问题讨论】:

    标签: asp.net-mvc unit-testing


    【解决方案1】:

    使用静态 HttpUtility 类及其 UrlDecode 方法。

    HttpUtility.UrlDecode(mystring);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多