Comment 0 for bug 1480019

Revision history for this message
Nick Moyle (1-ubunguone-8) wrote :

Under VS2015, when the Top level namespace of the classes holding nunit tests are different, but in the same project, the tests are found by Test Explorer, but not always executed. It appears to depend on which test is run first.

The Run All option is selected
The Playlist is set to All Tests
The Filter box is empty (well, says Search).
All tests are displayed in the Test Explorer
Only a portion of unit tests run.

You can set the Filter to FullName:"", and then all Tests will consistently execute.

There is no VS2015 documentation to indicate the default Filter, when one is not set, but it would appear that when there is no filter specified, that the nunit Adapter is doing something different.

A project with this issue can be found at https://github.com/fclp/fluent-command-line-parser.
Using this as the source, install the nUnit.Adapter from nuget

Load it up, hit Run All. On first compile all tests will be found and potentially execute. On subsequent re-runs, only those in the non-default namespace will run. If you change some code to force a new build, normally all tests will execute.

There are 4 classes in the FluentCommandLineParser.Tests.Internals namespace. If the CommandLineOptionFactoryTests.cs file is updated to the Fclp.Tests.Internals namespace, then all unit tests will run, even those that are in the non-default namespace.