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
Returning null #181
Returning null #181
Conversation
overkill? |
I think it's not overkill. I'm aware that this could be not mostly used method. That's why I've placed it in another namespace. |
Ok. Btw. R# as R language, ported to C# ex. R.NET? |
@veihan - I meant ReSharper |
lol |
I'm a nice guy mostly, so don't get me wrong here. This has already been discussed and it was answered by @dtchepak in late 2012 (read it #87) and generally the idea was rejected. |
Hi, any chances to add this CR to NSubstitute codebase? |
Hi Michal, As an aside I'm wary of including many more extensions like this; I want to avoid the situation where people find NSub works differently than they expect because there are fewer imports than a code sample they look at. I've let this one through just because it has kept coming up. :) Cheers, |
I added two methods that configure method call to return null:
Using one of these methods allows to write more easily code - instead of using
something.SomeAction().Returns(i=> null)
it can be written that way:something.SomeAction().ReturnsNull()
.With intellisense it's much easier to write call that should return null. In my opinion it's also much more verbose.
I've placed both methods in separate namespace so main namespace doesn't have too much mtehods.