-
Notifications
You must be signed in to change notification settings - Fork 261
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
Calling .Returns with the return value of a previously-configured substitute results in default value instead #603
Comments
Hi @joelhoward0 , Thanks for the great code example. This isn't really your mistake; it is an unfortunate downside to NSubstitute's syntax. The problem is that calling To work around this, replace the stub with Hope this helps. |
I see. Thank you for the explanation and for the workaround! It's better than what I had been doing. |
@dtchepak is this something which should be picked up by NS4000? |
@tpodolak I think it would be good if it is possible to add to NS4000. 👍 |
I'm not sure how to describe the situation better than the title, but here is the test (using NUnit and Shouldly)
test2.Id.ShouldBe(test1.Id);
fails because test2.Id returns null.This, however, works:
It seems like this must be a simple mistake I'm making, but I can't find it. What am I doing wrong here?
The text was updated successfully, but these errors were encountered: