NullReferenceException thrown when attempting to build unmet expectation message that includes an anonymous parameter
See original GitHub issueHello. I’m using FakeItEasy to test F# projects, and I much prefer it over Moq 😃
However there is one problem, and that is when making assertion that a call must have happened, the assertion message it prints is misleading at best: System.ArgumentNullException: Value cannot be null. (Parameter 'value')
. I wonder if this can be fixed somehow, either in my own code, or something you could fix on your side. I’ve included a small repository to to reproduce this issue, and also shows that it works as expected when testing a C# class
https://github.com/kaeedo/FakeItFSharp
I also noticed an old issue about adding an F# extension #232 . Any updates on that?
Thanks.
Issue Analytics
- State:
- Created 6 months ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
c# - What is a NullReferenceException, and how do I fix it?
If the person does not have a title, this will throw an exception because it is trying to call ToUpper on a property...
Read more >Add a FakeItEasy.FSharp package · Issue #232
NullReferenceException thrown when attempting to build unmet expectation message that includes an anonymous parameter #1920.
Read more >FakeItEasy (@fakeiteasyfx) / Twitter
Get FakeItEasy 7.4.0! fixed: NullReferenceException thrown when building unmet expectation message that includes an anonymous parameter.
Read more >Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >Null Reference Exception in Blazor Router - Matthew Champion
So this is a bit speculative, but I believe that the NullReferenceException is thrown in circumstances where the router is unable to correctly ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🥇 Thanks for the contribution @kaeedo. Look for your name in the release notes!
Actually, I see what the problem is: the Database implementation specifies a parameter name, but the interface doesn’t! If you just fix the interface to specify the parameter name, it should work as expected:
(we still need to fix the case where we don’t have the parameter name, though)