-
-
Notifications
You must be signed in to change notification settings - Fork 108
fix: convert xUnit Assert.All to TUnit All(predicate) instead of AllSatisfy #4346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…atisfy Fixes #4335 - xUnit Assert.All(collection, action) now converts to await Assert.That(collection).All(predicate) - Added TryConvertActionToPredicate to extract predicates from common xUnit assertion patterns (Assert.True, Assert.False, Assert.NotNull, etc.) - Also fixed MSTest migration to use All() instead of non-existent AllSatisfy() Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryFixes xUnit and MSTest migration to use the correct Critical IssuesNone found ✅ SuggestionsNone - the implementation is clean and well-tested. The predicate extraction logic handles common xUnit assertion patterns (Assert.True, Assert.False, Assert.NotNull, Assert.Null) intelligently, and the fallback behavior for unrecognized patterns is appropriate. TUnit Rules Check✅ No dual-mode concerns (not touching core engine or source generator) Verdict✅ APPROVE - Clean bug fix with proper test coverage. The conversion logic correctly transforms both xUnit |
Resolve merge conflicts to include Assert_Same, Assert_NotSame, and Assert_All tests. Updated test expectations to not expect System.Threading.Tasks since this branch doesn't have the code fix that adds it. Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryFixes xUnit Assert.All and MSTest AllItemsAreNotNull/AllItemsAreInstancesOfType migration to use the correct TUnit Critical IssuesNone found ✅ Suggestions1. Consider edge cases in TryConvertActionToPredicateThe
While the current implementation correctly falls back to returning the original expression (which will cause a compilation error and prompt manual conversion), adding these patterns could improve the migration experience. Impact: Low priority enhancement - current behavior is safe (compilation error prompts manual fix). 2. Lambda formatting consistencyIn No action needed - just confirming this is intentional and consistent. 3. Test coverage for fallback behaviorThe test Impact: Would improve test coverage but not critical since fallback behavior is simple. Verdict✅ APPROVE - No critical issues The fix correctly addresses issue #4335 by:
The code is well-structured with good separation of concerns ( |
Summary
Assert.All(collection, action)now converts toawait Assert.That(collection).All(predicate)instead of the non-existentAllSatisfymethodTryConvertActionToPredicateto extract predicates from common xUnit assertion patternsAll()instead of non-existentAllSatisfy()Test plan
🤖 Generated with Claude Code