ValeraT1982 / ObjectsComparer

C# Framework provides mechanism to compare complex objects, allows to override comparison rules for specific properties and types.
MIT License
354 stars 87 forks source link

Compare always returns true (is equal)? #56

Open tekeroth-snapcode opened 1 year ago

tekeroth-snapcode commented 1 year ago

I might have missed something important, but this does not seem to work at all for me?

The Compare method seems to return true (is equal) all the time, regardless if they objects are different or not. Here are two screenshots that shows this:

image In the image above, we can see that firstObject.IsReturnBooking is true, and secondCopy.IsReturnBooking is false.

If I then step one more line, and look at the isEqual and differences, they show that the objects are equal, no changes detected:

image

I am running .NET 7 in Visual Studio 2022, version of lib used is 1.4.1

ValeraT1982 commented 1 year ago

Can you please provide the definition of Booking?

To troubleshoot you can:

  1. Create 2 bookings and try to compare them (no deserialization).
  2. If the previous step works, create 2 JSON files with different bookings, deserialize and try to compare (no random property changes)

Try to create a minimal example that returns true when objects are different and include all code of that example.