bgs*_*264 5 asp.net iis-7 unit-testing windows-7
今天花了几个小时尝试针对ASP.NET项目编写一些单元测试.这是Visual Studio 2010.
将Windows 7 Enterprise与IIS7配合使用.
我采取的步骤是:
在使用IIS6计算机的Windows XP Professional上执行这些精确步骤时,它可以正常工作.
但是在IIS7上的Windows 7 Enterprise机器上,我得到:
指定的URL('http:// localhost/MyProject')与有效目录不对应.配置为在IIS中的ASP.NET中运行的测试需要存在URL的有效目录.URL可能无效或可能未指向有效的Web应用程序.
所以发生了什么,我可以确认我可以浏览到http:// localhost/MyProject并且它显示完美.
我确信我在Windows/IIS中缺少某种配置,但我真的很茫然.
生成的测试方法:
<TestMethod(), _
HostType("ASP.NET"), _
UrlToTest("http://localhost/MyProject")> _
Public Sub MyMethodTest()
Dim target As Member_Accessor = New Member_Accessor() ' TODO: Initialize to an appropriate value
Dim CurrentVal As Short = 0 ' TODO: Initialize to an appropriate value
Dim expected As Short = 0 ' TODO: Initialize to an appropriate value
Dim actual As Short
actual = target.MyMethod(CurrentVal)
Assert.AreEqual(expected, actual)
Assert.Inconclusive("Verify the correctness of this test method.")
End Sub
Run Code Online (Sandbox Code Playgroud)
(在ASP.NET论坛上交叉发布)
| 归档时间: |
|
| 查看次数: |
3420 次 |
| 最近记录: |