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

Improve enum comparison assert messages #923

Merged
merged 13 commits into from Sep 27, 2018

Conversation

krajek
Copy link
Contributor

@krajek krajek commented Sep 24, 2018

Applies changes discussed in #897.

Example of the new message:
"Expected enum to be EnumFour.Three(3) by value, but found EnumOne.Two(3)

Reviews are welcome.

@krajek krajek changed the title [WIP] Improve enum comparison assert messages Improve enum comparison assert messages Sep 25, 2018
@krajek
Copy link
Contributor Author

krajek commented Sep 25, 2018

@jnyrup Thanks for the review. All suggestions are implemented and is my opinion PR is ready to go

jnyrup
jnyrup approved these changes Sep 25, 2018
Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
Copy link
Member

@dennisdoomen dennisdoomen left a comment

Only minor comments. See the legend for the meaning of the emojis.

Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Equivalency/EnumEqualityStep.cs Outdated Show resolved Hide resolved
@@ -3599,6 +3595,26 @@ public void When_asserting_members_from_different_enum_types_are_equivalent_by_s
act.Should().NotThrow();
}

[Fact]
public void When_asserting_members_from_different_enum_types_are_equivalent_by_value_but_comparing_by_name_it_should_throw()
Copy link
Member

@dennisdoomen dennisdoomen Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 What are asserting members?

Copy link
Contributor Author

@krajek krajek Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you accept the change to "[...]asserting_that_members_from[...]"? BTW there are many places like this is this particular file and tens in other files :-).

Tests/Shared.Specs/EnumAssertionSpecs.cs Show resolved Hide resolved
@dennisdoomen dennisdoomen merged commit bbf703e into fluentassertions:master Sep 27, 2018
1 check passed
@krajek krajek deleted the better_enum_comparing branch Sep 27, 2018
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

3 participants