We have a utility project named Foo.Testing.Common
with helper classes for our real test projects, named things like Foo.Tests.Unit
and Foo.Tests.Integration
. The Common project doesn't have tests, just base classes, utility methods and the like. It references XUnit so I can use Xunit.Abstractions
.
How can we avoid seeing errors like the one below when we run all tests, either via .net command line or VS Test Explorer? The below error appears in VS Test Output during test discovery, for example.
No test is available in C:\Foo.Testing.Common\bin\Debug\netcoreapp3.1\Foo.Testing.Common.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException...
I assume the test process is matching on test to find test projects and then throws an error if one of those projects has no tests. Or maybe it's looking for projects that reference any xunit packages?
We could just rename the project, but is there a different way? Would like to avoid passing a list of specific test projects to the command line just to avoid the "no tests found" warnings. That is, dotnet test
should just work.
Update: I've also tried referencing just xunit.abstractions
and xunit.extensibility.core
rather than the main xunit
package, but the Common project still gets recognized as a test project.
Also tried setting IsTestProject
to false in the project properties.