Skip to content

Add option to ignore newline style when comparing strings for equivalency#2565

Merged
dennisdoomen merged 5 commits intofluentassertions:developfrom
vbreuss:topic/add-option-to-ignore-newline-differences
Apr 14, 2024
Merged

Add option to ignore newline style when comparing strings for equivalency#2565
dennisdoomen merged 5 commits intofluentassertions:developfrom
vbreuss:topic/add-option-to-ignore-newline-differences

Conversation

@vbreuss
Copy link
Copy Markdown
Contributor

@vbreuss vbreuss commented Jan 16, 2024

Add the following option to the EquivalencyAssertionOptions<T> for strings

public EquivalencyAssertionOptions<T> IgnoringNewlineStyle()
{
    // This will replace "\r\n" with "\n" in actual and expected before comparison
    return this;
}

This fixes #2612 and fixes #2566

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add string-option for ignoring newline style Incorrect line breaks handling with custom string comparer

8 participants