tes*_*der 23 c# asp.net-mvc unit-testing visual-studio-2012
我试图通过按"全部运行"在ASP.NET MVC中运行Visual Studio测试但是跳过了所有测试.为什么会发生这种情况?如何运行所有测试?这是一个截图:

使用Inconclusive结果的测试将显示为已跳过.所以VS 2010 inconclusive == VS 2012 skipped
例如:
Assert.Inconclusive("This test didn't exactly fail, but we can't be certain the results are good.")
Run Code Online (Sandbox Code Playgroud)
将在测试窗口中读取为已跳过
假设您之前的一项测试没有失败,则您的测试可能由于权限不足而被跳过。
您可以在测试中使用“TestCategories”注释。将它们标记为:
[TestCategory("Admin") TestMethod()]
public Void Test1()
{
...
}
Run Code Online (Sandbox Code Playgroud)
然后排除类别:
mstest /testcontainer:MyTestprojectName.dll /category:"!Admin"
您可以在每个测试中使用多个类别。有关深入信息: http://msdn.microsoft.com/en-us/library/dd286683.aspx
| 归档时间: |
|
| 查看次数: |
16375 次 |
| 最近记录: |