How does dotnet know the test framework? #2171
-
In my opinion, xunit is only a package like others, so how does dotnet find that xunit is a test framework and then start it? It looks like something magic! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The VS Test engine (which we plug into) finds test adapters by looking for NuGet package references that contain assemblies whose name ends in It even supports multiple test adapters in the same project. We validate that this works in our integration tests: https://github.com/xunit/xunit.integration/tree/main/test-explorer |
Beta Was this translation helpful? Give feedback.
The VS Test engine (which we plug into) finds test adapters by looking for NuGet package references that contain assemblies whose name ends in
.testadapter.dll
and it exposes types that implement the discovery and execution interfaces. It then dynamically loads that test adapter, and asks it to perform discovery on the assembly.It even supports multiple test adapters in the same project. We validate that this works in our integration tests: https://github.com/xunit/xunit.integration/tree/main/test-explorer