Fakes that wrap another object are not considered to be equal to themselves
See original GitHub issueI have found a behaviour that I might belive is a bug, here is how to reproduce:
var myClass = A.Fake<MyClass>(o => o.Wrapping(new MyClass()));
myClass.Equals(myClass); // This will not be true
// Which will result in that assertions like this will fail using Fluent Assertions:
myClass.Should().Be(myClass);
MyClass can be any class, for example an empty one like this public class MyClass{}
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (14 by maintainers)
Top Results From Across the Web
Advanced usage
GetFakeManager throws an exception if the provided object is not a fake. To test if an object is a fake you can call...
Read more >Prayer - Ellen G. White Writings
Prayer is not an expiation for sin; it has no virtue or merit of itself. All the flowery words at our command are...
Read more >Fakes - Sinon.JS
In Sinon, a fake is a Function that records arguments, return value, the value of this and exception thrown (if any) for all...
Read more >Best Practices for Spies, Stubs and Mocks in Sinon.js
Learn about differences between spies, stubs and mocks, when and how to use them, and get a set of best practices to help...
Read more >The hidden signs that can reveal a fake photo
If a photo has been tampered with, the shadows of some objects in the image may not match the light sources in the...
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
This change has been released as part of FakeItEasy 5.3.0.
Thanks, @twilek. Look for your name in the release notes! 🥇
In your case, I think it wouldn’t change anything. By default, the fake would behave the same as the concrete class, unless you explicitly configure its behavior.