0

我在 asp.net mvc4 应用程序的 Models 文件夹中有逻辑类:MyUtil.cs。

为 MyUtils.cs 自动生成的单元测试创​​建与网络服务器一起使用的单元测试(使用 attr:[HostType("ASP.NET")][UrlToTest("http://localhost:1139/") 等..])。

我应该改变什么以使这个单元测试在没有服务器的情况下运行?

谢谢,

约瑟夫

4

1 回答 1

1

The best and simplest solution would be to not use the auto-generator for unit tests but write the tests yourself. There are many articles and tutorials out there and this one can be a good place to start:

于 2012-09-11T10:38:51.590 回答