Vstest.console.exe找不到nunit测试 [英] Vstest.console.exe can't find nunit tests

查看:148
本文介绍了Vstest.console.exe找不到nunit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有VS 2017和.net 4.6

I have VS 2017 and .net 4.6

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

On trying to run via cmd prompt using vstest.console:

vstest.console.exe bin\Release\Tests.dll /UseVsixExtensions:true

我收到警告"/bin/Release/test.dll中没有可用的测试,请确保已安装的测试发现程序和执行程序,平台和框架版本设置正确,然后重试."

I am getting warning "No test is available in /bin/Release/test.dll Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again."

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

So, I tried listing the tests but it doesn't show any tests.

vstest.console.exe bin\Release\Tests.dll /ListTests /UseVsixExtensions:true

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

Unit tests class file is as shown below.

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

    }

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

    }
}

我尝试使用Google搜索类似问题,但没有发现任何可行的方法.任何帮助都非常感激

I tried googling for similar issue but didn't find anything that would work. Any help is really appreciated

推荐答案

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

Have you actually installed the NUnit 3 test adapter as a vsix?

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

If you are using the more usual approach of installing via nuget, you need to tell vstest.console.exe where to find the adapter using the /TestAdapterPath option.

这篇关于Vstest.console.exe找不到nunit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆