When running tests via vstest.console.exe using TestCaseFilter to filter based on TestCategory, the filter is not correctly applied when the tested assembly doesn't contain any tests that match the filter.
The filter is correctly applied if one or more tests in the tested assembly match the filter.
This is a breaking change in 3.16. I confirmed that this works correctly in 3.15.1.
The batch file executes vstest.console.exe against four test projects using a test category filter. Two of the test projects use NUnit3TestAdapter 3.15.1 and two of them use 3.16.
One project of each adapter version contains one test with a test category that matches the test category filter and the other contains only tests with no test category.
Expected
No tests are executed in the NoTestCategory315 and NoTestCategory316 projects.
Actual
All tests are (incorrectly) executed in the NoTestCategory316 project even though no test matches the filter.
NoTestCategory315 does not execute any tests as expected.
Problem
When running tests via vstest.console.exe using TestCaseFilter to filter based on TestCategory, the filter is not correctly applied when the tested assembly doesn't contain any tests that match the filter.
The filter is correctly applied if one or more tests in the tested assembly match the filter.
This is a breaking change in 3.16. I confirmed that this works correctly in 3.15.1.
Steps to recreate
The batch file executes vstest.console.exe against four test projects using a test category filter. Two of the test projects use NUnit3TestAdapter 3.15.1 and two of them use 3.16.
One project of each adapter version contains one test with a test category that matches the test category filter and the other contains only tests with no test category.
Expected
No tests are executed in the NoTestCategory315 and NoTestCategory316 projects.
Actual
All tests are (incorrectly) executed in the NoTestCategory316 project even though no test matches the filter.
NoTestCategory315 does not execute any tests as expected.