Skip to content
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

Register mocks as singletons #46

Merged
merged 1 commit into from
Mar 31, 2023
Merged

Register mocks as singletons #46

merged 1 commit into from
Mar 31, 2023

Conversation

xzxzxc
Copy link
Contributor

@xzxzxc xzxzxc commented Mar 27, 2023

Fixes #43

@tillig
Copy link
Member

tillig commented Mar 30, 2023

It seems like, since the "workaround" is basically to provide a singleton instance anyway... this seems like a reasonable fix.

Likely we'll need to release a major version since it'll be a breaking behavioral change, but that's fine.

Copy link
Member

@tillig tillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note about the unit test as an example.

test/Autofac.Extras.Moq.Test/AutoMockFixture.cs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1eff21e) 93.96% compared to head (930fff6) 93.96%.

❗ Current head 930fff6 differs from pull request most recent head 472c54a. Consider uploading reports for the commit 472c54a to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #46   +/-   ##
========================================
  Coverage    93.96%   93.96%           
========================================
  Files            3        3           
  Lines          116      116           
  Branches        20       20           
========================================
  Hits           109      109           
  Misses           5        5           
  Partials         2        2           
Impacted Files Coverage Δ
src/Autofac.Extras.Moq/MoqRegistrationHandler.cs 94.02% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@tillig tillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! It will be a bit before I can get a release out with this, but the MyGet feed will have interim builds you can consume if you're in a rush.

@tillig tillig merged commit 39a2693 into autofac:develop Mar 31, 2023
@xzxzxc xzxzxc deleted the singleton_mocks branch March 31, 2023 16:56
@xzxzxc
Copy link
Contributor Author

xzxzxc commented Jul 26, 2023

@tillig, Hi! Do you have plans to release this? MyGet is down, and I'm having trouble building my projects. Or could you create a prerelease version in NuGet, maybe?

@tillig
Copy link
Member

tillig commented Jul 26, 2023

Thanks for the reminder - let me see if I can get this today. Sorry for the delay!

tillig added a commit that referenced this pull request Jul 26, 2023
@tillig
Copy link
Member

tillig commented Jul 26, 2023

6.1.1 just got pushed, should start showing up in NuGet shortly.

@xzxzxc
Copy link
Contributor Author

xzxzxc commented Jul 26, 2023

@tillig, thank you!

BTW, previously you said that

Likely we'll need to release a major version since it'll be a breaking behavioral change, but that's fine.

Just curious, did you change your mind?

@tillig
Copy link
Member

tillig commented Jul 26, 2023

No, I just figured it was fixing a kind of bug, forgot about the major release part, incremented the bug release part, and called it a day. At some point we'll have to drop .NET 5 because it's no longer supported and that will also trigger a major release. Sorry for the confusion, day job is really kicking my ass in recent months so I'm just moving as fast as I can to get things done. Mistakes get made. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoMock.Mock<>() ignored in child lifetime scope
3 participants