My team recently consolidated several test projects which resulted in both unit and integration tests in the same project. Unfortunately some of our integration tests rely on resources not available locally so they fail:
Thankfully Visual Studio allows you to filter your tests in the Test Explorer. There are many options but its positive matching only (“not equal to” isn’t an option).
But it does support partial name matching so you can match on part of the namespace. For example, if you have your unit tests in a “Unit” folder you can use the filter value –
FullName:”.unit”
The bar at the top still shows red because I previously ran all tests and the integration tests were failing. If I click “Run All” again it will only execute the unit tests.
Happy Testing!