Skip to content

BeLowerCased() results in failing tests with only lower case characters.  #1768

@MEmanuelsson

Description

@MEmanuelsson

Description

Just introduced using BeLowerCased() into one of our tests where we want to assert that a file path is lower case, but the result is not as expected. The response I get from the failing test is as follows:

Expected all characters in carFolderPath to be lower cased, but found "\files\f7f9de7c-90f4-46a3-9ceb-97af53f495e3\carfiles\abc123".

Perhaps the back slash is considered an upper case character in some way?

Complete minimal example reproducing the issue

// Arrange 
var input = @"\test\with\lower\cased\string";

// Assert
input.Should().BeLowerCased();

Expected behavior:

Test to pass

Actual behavior:

Test fails

Versions

Fluentassertions: 6.3.0
.NET 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions