-
-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The lambda from the xUnit method Assert.Single<T>(IEnumerable<T> collection, Predicate<T> predicate) is dropped by the xUnit code fixer.
Expected Behavior
Assert.Single(properties, p => p.Prop == "myKey"); should become await Assert.That(properties.Where(p => p.Prop == "myKey")).HasSingleItem();.
Or, even better, an equivalent HasSingleItem overload that accepts a filter lambda is added to TUnit, allowing await Assert.That(properties).HasSingleItem(p => p.Prop == "myKey");.
Actual Behavior
Lambda was dropped entirely, leaving only await Assert.That(properties).HasSingleItem();
Steps to Reproduce
Apply xUnit code fixers against an xUnit assertion like Assert.Single(properties, p => p.Prop == "myKey");
TUnit Version
1.14.0
.NET Version
NET 10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working