When I run my SpecFlow+NUnit tests from Test Explorer, all tests always run, even if I have selected only some of the tests.
I also see this message which I suspect is related:
NUnit3TestExecutor discovered 0 of 1 NUnit test cases using Current Discovery mode, Explicit run
In addition, after the tests run, they are still marked as "Not run", even if they succeeded.
How can I fix this issue?
I fixed it by upgrading all the nuget packages in the solution to the latest version following advice in https://github.com/nunit/nunit-vs-adapter/issues/125. I don't know why that fixed it, but it did.
After upgrading the nuget packages I got an error:
System.IO.FileLoadException : Could not load file or assembly 'nunit.framework, Version=3.13.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This was fixed by following advice at https://github.com/SpecFlowOSS/SpecFlow/issues/2387: