Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure IdentityComparer.AreEqual Usage is Properly Asserted #3151

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

omidmloo
Copy link

Fixes: #3130

This PR addresses issue #3130 by ensuring that IdentityComparer.AreEqual(object object1, object object2) is used correctly across the codebase.

Changes Made:
✅ Replaced usages of IdentityComparer.AreEqual(object, object) with the overload that accepts CompareContext, ensuring proper validation.
✅ Removed the parameterless overload where possible to enforce assertion of the comparison result.
✅ In cases where removal wasn’t possible, I explicitly added CompareContext.Default.
✅ Verified and updated all affected test methods to ensure correctness.

Testing & Validation:
I ran all relevant unit tests to confirm that there were no regressions.
Verified that all assertions are now explicitly checked.

@omidmloo omidmloo requested a review from a team as a code owner February 28, 2025 21:25
@omidmloo omidmloo changed the title Ensure IdentityComparer.AreEqual Usage is Properly Asserted #3017 Ensure IdentityComparer.AreEqual Usage is Properly Asserted Feb 28, 2025
@omidmloo
Copy link
Author

@microsoft-github-policy-service agree

@omidmloo
Copy link
Author

omidmloo commented Mar 1, 2025

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Internal] IdentityComparer.AreEqual(object object1, object object2)
1 participant