Intellisense with NSubstitute not working
Hello,
I am using Resharper 7 with VS 2010 using C# and NSubstitute for Unit tests.
I am experiencing a problem with Intellisense whereby "Returns" is marked as invalid by ReSharper even though it is valid code which compiles and works correctly. Here's an example:
var mockRecordedOn = Substitute.For<IRecordedActionContext>();
mockRecordedOn.Oid().Returns("customer_3");
If I disable Resharper Intellisense then everything works as it should and I can use Intellisense to construct the code as I need it.
A fellow developer has the same setup as me and is not experiencing this problem. Any suggestions as to what I can try to get this working?
Many thanks in advance,
John
Please sign in to leave a comment.
Hi John,
Could you please specify the problem in detail?
I don't get how ReSharper IntelliSense can mark anything as 'invalid' - do you mean the Code Analysis and 'Cannot resolve' message with it?
Please let me know.
Thank you!
Hello,
Yes by not working I mean the Returns part of the line of code is highlighted in Red and Intellisense does not prompt for any options.
I would expect it not to compile from the way it is displayed, but it does and the code works as expected.
Thanks
John
Hello John,
Thanks for the detail.
Could you please create and provide me a small sample solution, which will demonstrate the issue?
Thank you in advance!