-
Notifications
You must be signed in to change notification settings - Fork 263
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
Provide more intuitive methods #782
Comments
I like the idea here, but IMO this GitHub issue is very broad and therefore hard to fix.
I don't know what this exactly means, other than the given examples |
Hi @BenjaminAbt , Sorry for the delayed response. A few notes on the existing commit:
As per @304NotModified's reply, if you have other specific examples please create an issue/s for them. 👍 |
Yes, that was the intention. I wanted to find out what the general attitude was before I put more time into it; also because there have been statements about it in the past (see above).
For sure.
Yes, I understand this, but I see devs struggling. IntelliSense is just normal in our .NET / Visual Studio ecosystem, and I just see developers browsing IntellISense instead of people looking at the docs. It's not a one-off thing either, I see it consistently.
Sounds good.
Yes.
There is one thing I do differently now and recommend to other people: use CHatGPT instead of GitHub Copilot to migrate from Moq to NSubstite. The results are better and people need less help with things they can't find the equivalent for. |
Is your feature request related to a problem? Please describe.
NSubstitute is a great library and is one the preferred test tool for mocks, not least because of the Moq Drama. However, some situations require code that are not intuitive and are comparatively inconvenient to implement. On the one hand, you can read this in many blogs that present migration docs from Moq to NSubstitute, but I also get this as feedback myself when I show different test libraries in training courses. So it is a real disadvantage in the everyday life of NSubstitute. I'm noticing it myself, as the number of requests for NSubstitute coaching / support is currently rising.
For example, converting
Times.AtLeast()
from Moq to NSubstitute is very inconvenient and not sustainable. There is the topic Received range of calls #558, in which there is a workaround withWithin
.In addition, the statement
Personal impressions are perfectly okay, and it would also be okay if several methods ultimately provide the same or similar tests.
The easier tests can be written, the better our .NET ecosystem will be.
Describe the solution you'd like
It would be great if many things were easier to implement with NSubstitute and people no longer had to google workarounds. That would make it easier to accept and move from Moq to NSubstitute.
A small example for fixing AtLeast - a specific case for my customers who are annoyed by this - can be implemented with just a few lines of code.
main...BenjaminAbt:NSubstitute:feature/more-methods
Like my customers, we are currently helping ourselves with extensions such as
but it would be better if there were sustainable, convenient and intuitive things directly in NSubstitute.
Thanks ♥
The text was updated successfully, but these errors were encountered: