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

Copy link
Member

@dennisdoomen dennisdoomen left a comment

Choose a reason for hiding this comment

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

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

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

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
@krajek krajek deleted the better_enum_comparing branch September 27, 2018 05:33
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