You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the comparison used in ShouldBeInAscendingOrder is different than what C# uses? At first, I ran into issues after an upgrade because the order seemed to be case sensitive now. But when trying to accommodate that (Which is why everything is in caps in my unit test) I still ran into issues. Thus, I got very basic - let C# sort and yet Should().BeInAscendingOrder() still fails.
The unit test fails for MS Test project on .NET Framework 4.8 when running FluentAssertions 6.9.
It seems that with that combination FluentAssertions is expecting the "INJECTANT-" to come before the "INJECTANT/" even though the OrderBy clause sorts the opposite.
FluentAssertions 6.8 and earlier this works fine.
xUnit and MS Test projects on .NET 6 work fine with FluentAssertions 6.9.
Regression?
This test will pass in FluentAssertions 6.8.0, but not in 6.9.0.
Is this commit the issue? 28ef506
Known Workarounds
Don't upgrade beyond 6.8.0 for MSTest projects on .NET Framework 4.8.
Configuration
MS Test Project on .NET Framework 4.8 with FluentAssertions 6.9.0.
Other information
No response
The text was updated successfully, but these errors were encountered:
FluentAssertionsIssue2109.zip
This is a solution with 3 different projects all using FluentAssertions 6.9.0.
xUnit on net6 works
MSTest on net6 works
MSTest on Net Framework 4.8 fails.
.NET5 changed behavior when comparing strings - docs. This probably explains the difference between net47 and net6
Fluent Assertions 6.9.0 changed what default comparer we use for comparing strings from culture aware to ordinal in Order strings with ordinal comparison #2075. Then intention is to behave identical on all TFMs.
A workaround is to pass in StringComparer.CurrentCulture to BeInAscendingOrder to compare the strings like OrderBy by default does.
Thanks for the information and the workaround for making the old test work as we migrate toward net6+. I could not find where OrderBy was changed in the documentation. But, it clearly was.
And I prefer that this test work, which it does on net6, but not on net48. I prefer that it work on net6. It should be symmetrical (i.e., OrderBy with no comparer should work with BeInAscendingOrder with no comparer).
Description
It seems that the comparison used in ShouldBeInAscendingOrder is different than what C# uses? At first, I ran into issues after an upgrade because the order seemed to be case sensitive now. But when trying to accommodate that (Which is why everything is in caps in my unit test) I still ran into issues. Thus, I got very basic - let C# sort and yet Should().BeInAscendingOrder() still fails.
Reproduction Steps
Expected behavior
The unit test to pass.
Actual behavior
The unit test fails for MS Test project on .NET Framework 4.8 when running FluentAssertions 6.9.
It seems that with that combination FluentAssertions is expecting the "INJECTANT-" to come before the "INJECTANT/" even though the OrderBy clause sorts the opposite.
FluentAssertions 6.8 and earlier this works fine.
xUnit and MS Test projects on .NET 6 work fine with FluentAssertions 6.9.
Regression?
This test will pass in FluentAssertions 6.8.0, but not in 6.9.0.
Is this commit the issue?
28ef506
Known Workarounds
Don't upgrade beyond 6.8.0 for MSTest projects on .NET Framework 4.8.
Configuration
MS Test Project on .NET Framework 4.8 with FluentAssertions 6.9.0.
Other information
No response
The text was updated successfully, but these errors were encountered: