Add CheckEquality method to IEqualizer for boolean-based equality checks#63
Open
Add CheckEquality method to IEqualizer for boolean-based equality checks#63
Conversation
Co-authored-by: TonyTroeff <33567383+TonyTroeff@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Introduce CheckEquality method to IEqualizer interface
Add CheckEquality method to IEqualizer for boolean-based equality checks
Nov 5, 2025
TonyTroeff
requested changes
Nov 8, 2025
Member
TonyTroeff
left a comment
There was a problem hiding this comment.
The changes look great. I added two minor suggestions.
TonyTroeff
requested changes
Nov 8, 2025
Member
TonyTroeff
left a comment
There was a problem hiding this comment.
The changes look great. I added two minor suggestions.
Co-authored-by: TonyTroeff <33567383+TonyTroeff@users.noreply.github.com>
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
TonyTroeff
approved these changes
Nov 8, 2025
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Pull Request Description
This PR introduces a new
CheckEqualitymethod to theIEqualizerinterface, providing a boolean-based alternative to the existing exception-basedAssertEqualityandAssertInequalitymethods. This addresses use cases where a simple true/false result is preferred over exception-based flow control.Motivation and Context
The
IEqualizerinterface previously only exposedAssertEqualityandAssertInequalitymethods, which throw exceptions on assertion failure. However, there are common scenarios where developers need to check equality without the overhead of exception handling. The newCheckEqualitymethod fills this gap by returning a boolean value (trueif equal,falseif not equal) without throwing exceptions.Changes Made
CheckEquality(object? expected, object? actual)method signature with XML documentationEqualize()internal method and returning theIsSuccessfulpropertyAssertEqualityandAssertInequality) that internally validate both the newCheckEqualitymethod and the original assertion methods, ensuring comprehensive coverage without adding redundant test casesUsage Example
The implementation reuses existing equalization logic without duplicating any comparison behavior. All existing tests now also validate that
CheckEqualityreturns the correct boolean value, providing thorough test coverage.Fixes #62
Checklist
Original prompt
CheckEqualitymethod #62✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.