Skip to content

Conversation

@thomhurst
Copy link
Owner

Summary

  • Add NUnit Does.Match and Does.Not.Match constraint support for migration
  • Add Is.Matches to the with-message version in NUnit migration
  • Fix MSTest migration to use correct method names IsSameReferenceAs and IsNotSameReferenceAs (was incorrectly using IsSameReference and IsNotSameReference)

Test plan

  • All 102 NUnit migration tests pass
  • All 32 MSTest migration tests pass
  • All 42 xUnit migration tests pass (1 skipped for assembly attributes)

🤖 Generated with Claude Code

thomhurst and others added 2 commits January 13, 2026 16:07
- Add Does.Match to convert to Matches()
- Add Does.Not.Match to convert to DoesNotMatch()
- Add Is.Matches to with-message version (was only in non-message)
- Add tests for Does.Not.EndWith, Does.Match, Does.Not.Match patterns

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…igration

The MSTest code fixer was using IsSameReference and IsNotSameReference
but the actual TUnit assertions are named IsSameReferenceAs and
IsNotSameReferenceAs.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@thomhurst
Copy link
Owner Author

Summary

This PR adds support for NUnit's Does.Match and Does.Not.Match constraint migration and corrects MSTest's reference equality assertion names from IsSameReference/IsNotSameReference to IsSameReferenceAs/IsNotSameReferenceAs.

Critical Issues

None found ✅

Observations

1. Recent Revert Context

The latest commit on main (83744ec) is a revert of the exact feature this PR re-introduces. The revert message indicates that commit d7aa43d was problematic. Question: What issue caused the revert, and has this PR addressed it?

2. Code Quality

The changes are well-structured:

  • MSTest migration properly uses IsSameReferenceAs/IsNotSameReferenceAs which matches the actual assertion names in TUnit.Assertions/Conditions/ReferenceEqualityAssertions.cs:10,47
  • NUnit migration adds Does.MatchMatches and Does.Not.MatchDoesNotMatch conversions
  • Test coverage includes both positive and negative cases for the new regex assertions
  • The DoesNotMatch and Matches assertions exist in TUnit.Assertions/Conditions/StringAssertions.cs

3. TUnit Rules Compliance

  • ✅ No dual-mode concerns (only migration code, not core engine)
  • ✅ No source generator output changes
  • ✅ No public API changes
  • ✅ No reflection or AOT concerns
  • ✅ Not in hot paths
  • ✅ No VSTest dependencies

4. Test Coverage

The PR adds comprehensive test coverage:

  • NUnit_Does_Not_EndWith_Converted (line 889)
  • NUnit_Does_Match_Converted (line 927)
  • NUnit_Does_Not_Match_Converted (line 965)

All tests follow the existing pattern and verify both the analyzer detection and code fix transformation.

Verdict

APPROVE - No critical issues, but recommend understanding why the previous version was reverted to ensure those issues don't reoccur.

@thomhurst thomhurst merged commit 75f904d into main Jan 13, 2026
13 checks passed
@thomhurst thomhurst deleted the feature/migration-fixes branch January 13, 2026 16:38
This was referenced Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants