-
Notifications
You must be signed in to change notification settings - Fork 5
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
Resolve method doesn't register created instance #19
Comments
@nimbusparis, that seems to be the proper way, according to the Configuring Specific Dependencies topic. If your first example ever worked, could you please provide the version numbers of
for which it worked and for which it doesn't? |
Just a tip, based on our recent experience updating the Moq integration to be compatible with Autofac v5, it may be worth looking at it as an example. It took us a couple of variations to get right. We did away with the Provide method as it is not really compatible with the immutable registry, and replaced the ACTNARS implementation with some sensible similar behaviour inside the custom handler. |
Packages versions: Well, I've try to make a simple sample but it doesn't fail with new version of AutoFake. |
@nimbusparis, if it doesn't fail with the new version of Autofac.Extras.FakeItEasy, am I right in understanding that you can move forward with your project? |
No, I've tried to create a sample with old packages and new and didn't make it fails. |
Hello, I've made other tests and I've found what fails. When you inject a concrete class in your system under test and provide an instance to autoFake, it inject different instance of the one returned before the SUT is created. See the code below:
|
While updating AutoFake from v 5.x to 6.0.0, many of my tests failed. It seems that the
Resolve
method for mock doesn't register it and I need to callProvide
with the returned instance:don't work, instance of
IInterface
injected in sut if not the same.Works
Could you have a look?
The text was updated successfully, but these errors were encountered: