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
Member

@jnyrup 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 fluentassertions#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 fluentassertions#1202 both of them failed.

This PR makes them both pass to minimize the change of behavior while fixing the asymmetry.
fluentassertions#1204 has a discussion of how to compare enums, integers and strings.
@jnyrup jnyrup merged commit 7b01b24 into fluentassertions:master Jan 1, 2020
@jnyrup jnyrup deleted the enum_equality branch January 1, 2020 18:43
@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
@jnyrup jnyrup restored the enum_equality branch October 27, 2020 07:21
@jnyrup jnyrup deleted the enum_equality branch January 23, 2021 08:20
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.

None yet

1 participant