New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DependencyInjection via Autofac not working properly using NUnit console (or testcentric GUI) #1353
Comments
Thanks for reporting this @Sputnik24 To help us out, are you able to share a csproj example that would show can the package versions and runtime for your example? EDIT: Another option for sharing this info could be to put up a PR for your repro in our https://github.com/nunit/nunit-console.issues repo |
Thanks for your comment @stevenaw I further investigated the issue and uploaded a simplified solution which reproduced the issue: https://github.com/Sputnik24/AutofacNUnit Details:
Behavior:
Details on ServiceFactory: Removing As or reducing it even to builder.Registertype(foundType).SingleInstance() doesn't work, either. In this case, the Assert.IsTrue fails as it cannot resolve the type, though it is registered. |
In my NUnit-Test I register some services using Autofac library:
When I run the test using testcentric GUI or nunit3-console.exe or dotnet nunit3-netcore-console.dll I receive the following exception
When I remove the IStarble form the builder, I get:
When I run the same using dotnet test, the test passes.
Is this an issue with NUnit Console/GUI or do I do something wrong?
Thanks a lot
Daniel
The text was updated successfully, but these errors were encountered: