When I try to run the tests, below message get displayed and none of the tests get executed
NUnit3TestExecutor discovered 0 of xxxx NUnit test cases using Current Discovery mode, Explicit run Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped)
But the tests are not marked as Explicit
Below is sample test I did for testing and when I run this test it gives the same message
[TestFixture]
public class SampleTest
{
[Test]
public void ShouldBeSuccess()
{
var result = 8;
Assert.AreEqual(result, 4 * 2);
}
}
Project and packages details/versions
.Net 4.6.2, NUnit 3.11.0, NUnit.ConsoleRunner 3.9.0, NUnit3TestAdapter 4.3.1, Visual Studio Professional 2019 Version 16.11.23
I have tried running these enabling /disabling "Discover test in realtime.."
Any idea of what causing this
See the article here: https://docs.nunit.org/articles/vs-test-adapter/Adapter-Engine-Compatibility.html
The adapter version 4.3.1 require console runner 3.15.2. Using any other version may result in "No tests found".
From the article above:
Also, including the package there for the NUnit consolerunner at all is not a good practice, for the same reason of possible interference between the adapter's embedded engine and the consolerunner's embedded engine. The console runner is not needed for running with Visual Studio or dotnet test.
If you really really need the console runner, it is better to install it as a dotnet tool
dotnet tool install --global NUnit.ConsoleRunner.NetCore --version 3.15.2.And run it like
nunit --test=TestNameSpace.TestClass(Android).SomeTest bin/debug/net6.0/runbyfqn.dllSince you already have the adapter there, you have the
dotnet testoption too.