Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Oct 29, 2023

Enhance the EquivalencyOptions to support the following methods:

  • IgnoringLeadingWhitespace
    Instructs the comparison to ignore leading whitespace when comparing strings.
  • IgnoringTrailingWhitespace
    Instructs the comparison to ignore trailing whitespace when comparing strings.
  • IgnoringCase
    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.

  • BeEquivalentTo
  • ContainEquivalentOf
  • EndWithEquivalentOf
  • MatchEquivalentOf
  • NotBeEquivalentTo
  • NotContainEquivalentOf
  • NotEndWithEquivalentOf
  • NotMatchEquivalentOf
  • NotStartWithEquivalentOf
  • StartWithEquivalentOf

Details are discussed in and fixes #2364.
Fixes #2339
Fixes #2064

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

@github-actions

This comment was marked as outdated.

@vbreuss
Copy link
Contributor Author

vbreuss commented Oct 29, 2023

If this pull request is accepted, it replaces #2372

@coveralls
Copy link

coveralls commented Oct 29, 2023

Pull Request Test Coverage Report for Build 7436672942

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 302 of 306 (98.69%) changed or added relevant lines in 10 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 97.45%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Src/FluentAssertions/Primitives/StringAssertions.cs 200 201 99.5%
Src/FluentAssertions/Primitives/StringContainsStrategy.cs 11 12 91.67%
Src/FluentAssertions/Primitives/StringEndStrategy.cs 16 17 94.12%
Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs 5 99.03%
Totals Coverage Status
Change from base Build 7378622478: -0.02%
Covered Lines: 11943
Relevant Lines: 12130

💛 - Coveralls

@vbreuss vbreuss marked this pull request as ready for review October 30, 2023 11:30
@vbreuss
Copy link
Contributor Author

vbreuss commented Oct 30, 2023

@dennisdoomen :
I don't understand why the Qodana Scan fails. Is it a problem with the pipeline or with the code changes? Can I see somewhere, what the actual failures are (the raw build log is not really helpful for me)?

@dennisdoomen
Copy link
Member

I don't understand why the Qodana Scan fails. Is it a problem with the pipeline or with the code changes? Can I see somewhare, what the actual failures are (the raw build log is not really helpful for me)?

Is that because you're branch is behind and needs to rebase?

@vbreuss
Copy link
Contributor Author

vbreuss commented Oct 30, 2023

Is that because you're branch is behind and needs to rebase?

I doubt it, as the build ran and the failure was before the merge of #2416 to develop.
Nonetheless I rebased the branch to get rid of the conflicting files.

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.

That's a pretty impressive PR. It just needs a little cleaning up here and there.

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.

Nice work

@IT-VBFK
Copy link
Contributor

IT-VBFK commented Nov 9, 2023

@vbreuss Can you try behavior instead of behaviour in string.md and check if that silence the spell check?
And if so, probably you could add the british version to the custom dict. ;)

@vbreuss
Copy link
Contributor Author

vbreuss commented Nov 9, 2023

@vbreuss Can you try behavior instead of behaviour in string.md and check if that silence the spell check? And if so, probably you could add the british version to the custom dict. ;)

Yes, changing it to behavior does indeed fix the spell check error.
image

Sorry, I was not aware, that I need to run it locally! 😃

@IT-VBFK : Where can I find the custom dictionary?

@IT-VBFK
Copy link
Contributor

IT-VBFK commented Nov 9, 2023

in the repository root cSpell.json -> words :)

@dennisdoomen
Copy link
Member

And if so, probably you could add the british version to the custom dict. ;)

It's not completely obvious, but we're using US English as our standard.

@ITaluone
Copy link
Contributor

I think the PR title is litte outdated? Should this go to "Allow specifying EquivalencyOptions in string assertions" instead?

@vbreuss vbreuss changed the title Allow specifying EquivalencyAssertionOptions in string assertions Allow specifying EquivalencyOptions in string assertions Nov 16, 2023

This comment was marked as outdated.

@dennisdoomen
Copy link
Member

What's the status of this PR?

@vbreuss
Copy link
Contributor Author

vbreuss commented Jan 3, 2024

What's the status of this PR?

From my side it is complete, I am waiting for reviews. I am not sure, what the issue is with the Qodana scan. Should I rebase and try again?

@dennisdoomen
Copy link
Member

dennisdoomen commented Jan 3, 2024

I am not sure, what the issue is with the Qodana scan. Should I rebase and try again?

Some changes were made to the Qodana scanner since the last time your PR got build. Although it's weird that your PR didn't get rebuilt.

Copy link

github-actions bot commented Jan 3, 2024

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@vbreuss
Copy link
Contributor Author

vbreuss commented Jan 3, 2024

Some changes were made to the Qodana scanner since the last time your PR got build. Although it's weird that your PR didn't get rebuilt.

I merged the latest develop branch and now all seems fine for Qodana 😄

@vbreuss vbreuss requested a review from jnyrup January 3, 2024 14:43
This was referenced Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants