Skip to content

Feature request: make a version from string BeEquivalentTo which ignores \n <> \r\n #1247

@StefH

Description

@StefH

Description

The currentBeEquivalentTo() method asserts that a string is exactly the same as another string, including any leading or trailing whitespace, with the exception of the casing.

It would be very useful to add a new method or extend this method to support also \n and \r\n.

Complete minimal example reproducing the issue

// Arrange
string expected= "foo\r\n";

// Act
string result = "foo\n";

// Assert
result.Should().BeEquivalentTo(expected);

Expected behavior:

Assertion is OK

Actual behavior:

Assertion FAILS

Versions

  • Latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationfeature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions