-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
Allow specifying EquivalencyOptions
in string assertions
#2413
Allow specifying EquivalencyOptions
in string assertions
#2413
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
If this pull request is accepted, it replaces #2372 |
Pull Request Test Coverage Report for Build 7436672942Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
abf2b80
to
9f7b5a7
Compare
@dennisdoomen : |
Is that because you're branch is behind and needs to rebase? |
78df3d1
to
0fd9a21
Compare
I doubt it, as the build ran and the failure was before the merge of #2416 to |
b29c449
to
b9e138c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a pretty impressive PR. It just needs a little cleaning up here and there.
Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs
Outdated
Show resolved
Hide resolved
f3e71aa
to
dcf73ff
Compare
548562e
to
5b84065
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs
Outdated
Show resolved
Hide resolved
@vbreuss Can you try |
Yes, changing it to Sorry, I was not aware, that I need to run it locally! 😃 @IT-VBFK : Where can I find the custom dictionary? |
in the repository root |
It's not completely obvious, but we're using US English as our standard. |
I think the PR title is litte outdated? Should this go to "Allow specifying |
EquivalencyAssertionOptions
in string assertionsEquivalencyOptions
in string assertions
… `CollectionMemberOptionsDecorator`
…sing `IgnoringLeadingWhitespace`
…ivalentTo` mentioned in fluentassertions#2064
303e73a
to
0572cd4
Compare
@dennisdoomen :
I was not aware of this guideline. The build is now also successful after a rebase 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small things.
very impressive work ❤️
I don't understand how the linked PR that closes this issue solves my problem. It doesn't fix the next bug, which I pointed out earlier: public static string RemoveNewLines(this string @this)
{
return @this.Replace("\n", string.Empty, StringComparison.Ordinal)
.Replace("\r", string.Empty, StringComparison.Ordinal)
.Replace(@"\r\n", string.Empty, StringComparison.Ordinal);
} Note the Aside from that, how do these changes affect my use case? In other words, what FA extension method should I be using now to pass my custom string comparer (without also ignoring leading/trailing whitespace, line breaks, casing, etc)? |
@bart-vmware : subject.Should().BeEquivalentTo(expected, o => o
.Using(IgnoreLineEndingsComparer.Instance));
Or do you mean another issue? |
Enhance the
EquivalencyOptions
to support the following methods:Instructs the comparison to ignore leading whitespace when comparing strings.
Instructs the comparison to ignore trailing whitespace when comparing strings.
Instructs the comparison to compare strings case-insensitive.
Add an overload for the following string assertions that accept a
Func<EquivalencyOptions<string>, EquivalencyOptions<string>> config
.Details are discussed in and fixes #2364.
Fixes #2339
Fixes #2064
IMPORTANT
./build.sh --target spellcheck
or.\build.ps1 --target spellcheck
before pushing and check the good outcome