Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vstest.console.exe can't find nunit tests

I have VS 2017 and .net 4.6

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

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

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()
    {

    }
}

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

like image 284
roxy Avatar asked Nov 28 '17 19:11

roxy


1 Answers

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

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.

like image 179
Charlie Avatar answered Sep 28 '22 13:09

Charlie