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

Treat enums and their numeric representations in structural object graph comparisons the same #1208

Merged
merged 1 commit into from Jan 1, 2020

Conversation

@jnyrup
Copy link
Collaborator

jnyrup commented Dec 28, 2019

Before #1202 we had an asymmetry where:

  • When_comparing_an_enum_and_a_numeric_for_equality_it_should_not_throw passed, but
  • When_comparing_a_numeric_and_an_enum_for_equality_it_should_not_throw failed.

After #1202 both of them failed.

This PR makes them both pass to minimize the change of behavior while fixing the asymmetry.
#1204 has a discussion of how to compare enums, integers and strings.

Before #1202 we had an asymmetry where:
* `When_comparing_an_enum_and_a_numeric_for_equality_it_should_not_throw` passed, but
* `When_comparing_a_numeric_and_an_enum_for_equality_it_should_not_throw` failed.

After #1202 both of them failed.

This PR makes them both pass to minimize the change of behavior while fixing the asymmetry.
#1204 has a discussion of how to compare enums, integers and strings.
@jnyrup jnyrup merged commit 7b01b24 into fluentassertions:master Jan 1, 2020
1 check passed
1 check passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@jnyrup jnyrup deleted the jnyrup:enum_equality branch Jan 1, 2020
@dennisdoomen dennisdoomen changed the title Fix comparing enums and integers for equality Treat enums and their numeric represents in equivalency comparisons the same Jan 1, 2020
@dennisdoomen dennisdoomen changed the title Treat enums and their numeric represents in equivalency comparisons the same Treat enums and their numeric representations in structural object graph comparisons the same Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.