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

Replace MOQ with NSubstitute #1390

Merged
merged 4 commits into from Nov 7, 2023
Merged

Conversation

aydjay
Copy link

@aydjay aydjay commented Aug 10, 2023

As per the huge discussion chain here:

https://github.com/moq/moq/issues/1372

Replace MOQ with NSubstitute

Alex Jones added 2 commits August 10, 2023 14:04
Due to the debacle seen over in the MOQ project around
the exfiltration of user data, use NSubstiture in favour of MOQ
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dc4e4cd) 78.49% compared to head (8c32a76) 78.44%.
Report is 15 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1390      +/-   ##
===========================================
- Coverage    78.49%   78.44%   -0.06%     
===========================================
  Files          199      201       +2     
  Lines         5706     5715       +9     
  Branches      1166     1169       +3     
===========================================
+ Hits          4479     4483       +4     
- Misses         714      717       +3     
- Partials       513      515       +2     

see 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tillig
Copy link
Member

tillig commented Aug 10, 2023

Thanks! I'm going to hold on this a moment and see how this pans out. The current version we're referencing doesn't have the privacy issues noted and, from a short term perspective, we can always just pin <4.20.0 as the package reference. If this changes and a newer version of Moq comes out without this issue, we can "jump" to the new one, still saving some time. And if it doesn't... well, then this PR will come in handy.

@aydjay
Copy link
Author

aydjay commented Aug 10, 2023

No trouble at all, thanks for the speedy response.


contextMock.Verify(context => context.Instance, Times.Once);
contextMock.Verify(context => context.Registration.Options, Times.Once);
_ = contextMock.Received(1).Instance;
Copy link
Member

Choose a reason for hiding this comment

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

This discard construct reads kind of weird. Is there an error of some nature if the discard part is omitted?

Copy link
Author

Choose a reason for hiding this comment

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

Good spot! My mistake.


resolveRequestContextMock.Verify(context => context.Operation.RequestDepth, Times.Never);
_ = resolveRequestContextMock.Received().Operation.RequestDepth;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like there's another of those discard items here.

Copy link
Author

Choose a reason for hiding this comment

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

Corrected, as requested.

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.

Thanks again, this is great!

@tillig tillig merged commit 5af8326 into autofac:develop Nov 7, 2023
3 checks passed
@aydjay
Copy link
Author

aydjay commented Nov 7, 2023

Thanks again, this is great!

You're welcome, pleasure to work with you.

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.

None yet

2 participants