test: add xUnit migration tests for Assert.Empty and using directive removal#4430
Merged
test: add xUnit migration tests for Assert.Empty and using directive removal#4430
Conversation
…removal Add test coverage proving that the xUnit code fixer correctly handles: - Assert.Empty(List<T>) -> await Assert.That(list).IsEmpty() - Assert.NotEmpty(List<T>) -> await Assert.That(list).IsNotEmpty() - Assert.Empty(Array) -> await Assert.That(array).IsEmpty() - Using directive removal (using Xunit; and using Xunit.Abstractions;) These tests verify that issues #4416, #4417, #4418, #4419, #4420 are working correctly with the existing code fixer implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
SummaryAdds test coverage proving that xUnit migration code fixer correctly handles Critical IssuesNone found ✅ SuggestionsNone - these tests follow established patterns and provide valuable coverage for previously reported issues. Verdict✅ APPROVE - No critical issues The tests verify that reported issues (#4418, #4417, #4419, #4416/#4420) already work correctly. Good defensive testing to prevent regressions. |
This was referenced Jan 15, 2026
This was referenced Feb 9, 2026
This was referenced Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add test coverage proving that the xUnit code fixer correctly handles reported issues:
Assert.Empty(List<T>)->await Assert.That(list).IsEmpty()Assert.NotEmpty(List<T>)->await Assert.That(list).IsNotEmpty()Assert.Empty(Array)->await Assert.That(array).IsEmpty()using Xunit;andusing Xunit.Abstractions;)Investigation Findings
These tests verify that the following reported issues already work correctly:
Assert.Emptyfor collectionsIsEmpty()exists onCollectionAssertionBaseusing Xunit;not removedMigrationHelpers.RemoveFrameworkUsings()handles itAssert.Throwsloses exceptionBatchFixeris configured correctlyThe issues appear to be either from older versions of TUnit or IDE-specific behavior.
Test Plan
🤖 Generated with Claude Code