Vstest.console.exe找不到nunit测试

rox*_*oxy 4 selenium nunit vstest.console.exe

我有VS 2017和.net 4.6

在尝试使用vstest.console通过cmd提示符运行时:

vstest.console.exe bin\Release\Tests.dll /UseVsixExtensions:true
Run Code Online (Sandbox Code Playgroud)

我收到警告“ /bin/Release/test.dll确保已安装的测试发现程序和执行程序,平台和框架版本设置适当,然后再试一次”中没有可用的测试。

因此,我尝试列出测试,但未显示任何测试。

vstest.console.exe bin\Release\Tests.dll /ListTests /UseVsixExtensions:true
Run Code Online (Sandbox Code Playgroud)

单元测试类文件如下所示。

[TestFixture]
public class class1
    {
    static void StartTest(string[] args)
    {

    }

 [Test] [Category("Regression_Test")]   
    public void TS1()
    {

    }
}
Run Code Online (Sandbox Code Playgroud)

我尝试使用Google搜索类似问题,但是没有找到任何可行的方法。任何帮助都非常感谢

Cha*_*lie 5

您是否已将NUnit 3测试适配器实际安装为vsix?

如果您使用更常用的通过nuget安装的方法,则需要vstest.console.exe使用该/TestAdapterPath选项来告诉您在哪里可以找到适配器。