question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fakes that wrap another object are not considered to be equal to themselves

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
blairconradcommented, Oct 16, 2019

This change has been released as part of FakeItEasy 5.3.0.

Thanks, @twilek. Look for your name in the release notes! 🥇

1reaction
thomaslevesquecommented, Sep 27, 2019

I thought it was just easier to make the already existing one to a wrapped object 😃

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found