One of the recurring frustrations in .NET testing is that Xunit does not provide built-in dependency injection in the same way that ASP.NET Core applications do. That gap tends to push teams toward ad hoc setup code, repetitive fixture patterns, or test construction approaches that feel increasingly detached from the way the application itself is wired.
Umplify’s xunit-dependency-injection library closes that gap by bringing Microsoft’s dependency injection container into Xunit through fixture-based infrastructure, property injection, and newer constructor-oriented patterns. The practical advantage is not only convenience. It is architectural consistency. Teams can test services using a composition model that is much closer to production.
The library is especially useful because it supports more than one adoption style. Teams can keep the traditional fixture approach, move toward [Inject] property injection for cleaner syntax, or adopt patterns gradually without breaking existing tests. Support for configuration, user secrets, service lifetimes, keyed services, and async disposal makes it much more than a thin helper package.
That matters in real codebases. Test design improves when the container can manage dependencies predictably, when setup logic is centralized, and when integration-style tests feel less artificial. The result is usually cleaner tests, easier migration paths, and fewer inconsistencies between production architecture and test architecture.
For teams already invested in the Microsoft.Extensions ecosystem, using the same conceptual model in tests is often a meaningful improvement rather than a small ergonomic win.
You can explore the project on GitHub and install it via NuGet.