roxy
roxy

Reputation: 71

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

Upvotes: 6

Views: 5176

Answers (3)

75ntamas
75ntamas

Reputation: 320

Use this way:

"<full_path_of_exe>\vstest.console.exe" "<full_path_of_dll>\NUnitTestProject.dll" /TestAdapterPath:"<point_to_the_FOLDER_where_your_NUnit3.TestAdapter.dll_is>"

Upvotes: 2

Dominic Jonas
Dominic Jonas

Reputation: 5005

Like Charlie already mentioned. Just install the nuget package in your project and everything ist fine!

https://www.nuget.org/packages/NUnit3TestAdapter/


The old NUnit 3 Test Adapter extenion won't be supported anymore in future!

https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter#overview

NOTE: - EARLY WARNING: Please observe that VSIX test adapters will be deprecated in the upcoming Visual Studio 2019. Please add the nuget adapter package to your solutions instead. See further information here and here

Upvotes: -2

Charlie
Charlie

Reputation: 13726

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.

Upvotes: 8

Related Questions