feat(migration): add NUnit CollectionAssert and StringAssert support#4365
feat(migration): add NUnit CollectionAssert and StringAssert support#4365
Conversation
- Add NUnit CollectionAssert migration support for: - Contains, DoesNotContain - IsEmpty, IsNotEmpty - AreEqual, AreNotEqual, AreEquivalent, AreNotEquivalent - AllItemsAreUnique, AllItemsAreNotNull - IsSubsetOf, IsSupersetOf, IsOrdered - Add NUnit StringAssert migration support for: - Contains, DoesNotContain - StartsWith, DoesNotStartWith - EndsWith, DoesNotEndWith - IsMatch, DoesNotMatch - AreEqualIgnoringCase, AreNotEqualIgnoringCase - Fix MSTest IsSameReference -> IsSameReferenceAs method name Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SummaryAdds NUnit migration support for CollectionAssert (11 methods) and StringAssert (9 methods), plus fixes MSTest IsSameReference method name. Critical Issues1. Missing TUnit assertion method: IsInAscendingOrder ❌ NUnitMigrationCodeFixProvider.cs:565 maps: "IsOrdered" when arguments.Count >= 1 => CreateTUnitAssertion("IsInAscendingOrder", arguments[0].Expression),However, TUnit.Assertions only provides:
There is no Fix: Change to "IsOrdered" when arguments.Count >= 1 => CreateTUnitAssertion("IsInOrder", arguments[0].Expression),2. Missing TUnit assertion methods: DoesNotStartWith and DoesNotEndWith ❌ NUnitMigrationCodeFixProvider.cs:590-593 maps: "DoesNotStartWith" => CreateTUnitAssertion("DoesNotStartWith", ...)
"DoesNotEndWith" => CreateTUnitAssertion("DoesNotEndWith", ...)However, TUnit.Assertions only provides:
Fix: These assertions don't exist in TUnit yet. You should either:
Suggestions
Previous Review StatusNo previous comments found. Verdict |
…h/DoesNotEndWith assertions - Change IsInAscendingOrder to IsInOrder (TUnit uses IsInOrder for ascending order) - Add StringDoesNotStartWithAssertion and StringDoesNotEndWithAssertion - Update tests to match new assertion names - Migration now correctly converts NUnit Does.Not.StartWith and Does.Not.EndWith Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addressed Review FeedbackI've addressed the issues identified in the review: 1. IsInAscendingOrder → IsInOrder ✅Changed all occurrences of 2. DoesNotStartWith and DoesNotEndWith ✅Instead of removing these conversions, I added the missing assertion methods to TUnit:
Both assertions follow the same pattern as existing string assertions and include:
TestsAll migration tests pass:
|
SummaryAdds NUnit migration support for CollectionAssert and StringAssert methods, plus fixes MSTest IsSameReference method name and adds new string assertion methods to TUnit. Critical IssuesNone found ✅ Previous Review StatusAll issues from the previous review have been addressed:
Additional ObservationsTUnit Rules Compliance
Code Quality
Minor Notes
Verdict✅ APPROVE - All critical issues resolved, TUnit rules followed, implementation is solid |
…With assertions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SummaryAdds NUnit CollectionAssert and StringAssert migration support, plus fixes MSTest IsSameReferenceAs method name. Critical IssuesNone found ✅ SuggestionsMinor: Overly specific pattern matching in DoesNotMatch expectationIn if (expression.Contains(".DoesNotMatch(regex)") || expression.Contains(".DoesNotMatch(DoesNotMatch_") || expression.Contains(".DoesNotMatch(FindNumber"))The TUnit Rules Compliance✅ Snapshot Testing (Rule 2): Public API changes correctly tracked with ✅ Code Quality:
✅ Test Coverage: PR description indicates all 183 migration tests pass (109 NUnit + 32 MSTest + 42 xUnit) Verdict✅ APPROVE - No critical issues. The suggestion is a minor style preference that doesn't affect functionality. |
Summary
Add NUnit
CollectionAssertmigration support for all common methods:Contains,DoesNotContainIsEmpty,IsNotEmptyAreEqual,AreNotEqual,AreEquivalent,AreNotEquivalentAllItemsAreUnique,AllItemsAreNotNullIsSubsetOf,IsSupersetOf,IsOrderedAdd NUnit
StringAssertmigration support for all methods:Contains,DoesNotContainStartsWith,DoesNotStartWithEndsWith,DoesNotEndWithIsMatch,DoesNotMatchAreEqualIgnoringCase,AreNotEqualIgnoringCaseFix MSTest
IsSameReference->IsSameReferenceAsmethod name (was using incorrect method name)Test plan
🤖 Generated with Claude Code