question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

String .BeEquivalentTo() is case-sensitive on linux

See original GitHub issue

It seems that BeEquivalentTo() doesn’t ignore case when comparing strings on Linux environment.

"SomeString".Should().BeEquivalentTo("somestring");

Expected: verification passes.

It works as expected on Windows, but throws but "SomeString" differs near "Som" (index 0) exception on Linux.

On the same environment string assertion from NUnit framework works as expected.

StringAssert.AreEqualIgnoringCase("SomeString", "somestring");

Info:

  • FluentAssertions v5.7.0
  • .netcoreapp 2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jnyrupcommented, Nov 8, 2019

I wouldn’t mind including the extra xunit code. It could maybe combine it with [CollectionDefinition] to disable parallelization for those tests mingling with the CurrentCulture, see an example in AssertionOptionSpecs.cs

1reaction
eNeRGy164commented, Aug 1, 2019

You could switch to StringComparison.OrdinalIgnoreCase explicitly for comparisons

You mean in FA?

Yeah, I find it strange that about half of the StringAssertions use Ordinal, and half use CurrentCulture. It is probably a breaking change. But having code be asserted differently depending on your machine is also not expected I guess.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fluent assertions - How to compare case insensitive string ...
How can I easy compare string case insensitive using FluentAssertions? Something like: symbol.Should().Be(expectedSymbol, StringComparison.
Read more >
getdate(3p) - Linux manual page - Michael Kerrisk
The getdate() function shall convert a string representation of a date or time ... and input specification performed by getdate() shall be case-insensitive....
Read more >
5 Linguistic Sorting and Matching
The ordering of strings in a set is called sorting. For example, the ORDER BY clause uses ... Case-Insensitive and Accent-Insensitive Linguistic Collation....
Read more >
Documentation: 15: 4.1. Lexical Structure
Key words and unquoted identifiers are case insensitive. ... A string constant in SQL is an arbitrary sequence of characters bounded by single...
Read more >
Device Tree Linux
Node names are supposed to be case sensitive. The function that checks whether a node name matches a string may be defined by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found