-
Notifications
You must be signed in to change notification settings - Fork 152
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. |
@Sputnik24 Can you try this using the latest build of |
@CharliePoole Retestet wit NUnit Console Runner 3.18.3-dev00009. Issue still occurs:
|
A workaround may be to use |
Same error |
OK, I'll move ahead with the release and come back to this issue in the 3.19 series. |
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: