-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1470
Comments
Are there any plans to fork the Moq? I have not used NSubstitute personally, so I can't comment on that. It seems some folks find it cleaner compared to Moq. If the switch is straightforward, we can get away with that. |
There is already an issue for creating a migration tool: nsubstitute/NSubstitute#720 I would probably wait and see in this case, how it develops. The latest version of Moq no longer has that dependency, so I would say it's not immediate concern. |
Thanks for the link, I'll bear that in mind for the future. I have however just finished locally converting the code over 😅 |
Remove Moq and replace with NSubstitute. Resolves App-vNext#1470.
I am looking at the PR and to be honest, I like the syntax more than Moq. Never used NSubstitute before. |
Remove Moq and replace with NSubstitute. Resolves #1470.
Hello, I'm worried about this situation, we use Moq in my company and I'm willing to replace it ASAP. Is NSubistitute safe and easy to migrate from Moq? Thanks ! |
This specific code base maybe took me about an hour, others have taken 15 minutes, others still I stopped and reverted the changes and I'll tackle them another time. From my experiences today, it seems to mostly be a function of how much you use functionality like In the simplest cases, it's just a matter of a change like this: - var thing = Mock.Of<Thing>();
+ var thing = Substitute.For<Thing>(); The more coupled your tests are to verifying the behaviour of the underlying code through Mock, then the more effort the migration appears to be. |
Given recent developments with Moq as of version 4.20.0, we should remove it and replace with another library.
NSubstitue seems like a good substitue.
I'm going to work on this today unless someone has any strong opinions about an alternative library to use in its place.
The text was updated successfully, but these errors were encountered: