-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationenhancement
Milestone
Description
Description
When trying to assert a Collection of string with Equivalence (in order to ignore case), these 2 approaches, although they look the same, they differ. In fact, the Should().AllSatisfy(x => x.Should().BeEquivalentTo("this")) PASSES while Should().AllBeEquivalentTo("this") FAILS
Complete minimal example reproducing the issue
[Test]
public void Test_AllBeEquivalent()
{
List<string> data = new() {"this", "tHis", "This", "THis", "thIS"};
data.Should().AllSatisfy(x => x.Should().BeEquivalentTo("this")); //PASS
data.Should().AllBeEquivalentTo("this"); //FAIL
}Expected behavior:
data.Should().AllBeEquivalentTo("this") should PASS
Actual behavior:
data.Should().AllBeEquivalentTo("this") FAIL
Versions
- Fluent Assertions 6.8
- .NET 6
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationenhancement
Type
Projects
Status
✅ Done