-
-
Notifications
You must be signed in to change notification settings - Fork 106
Simplify IsIn / IsNotIn assertions #3579
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
… and improve IsIn syntax
# Conflicts: # TUnit.Assertions/Extensions/AssertionExtensions.cs
|
Claude finished @thomhurst's task —— View job Pull Request Review: Simplify IsIn / IsNotIn assertionsTodo List:
Review SummaryThis PR successfully simplifies the IsIn/IsNotIn assertions by replacing the complex manual assertion classes with a cleaner source-generated approach. The changes are well-executed and follow TUnit's architectural principles. ✅ Strengths
🔍 Technical AnalysisPerformance Improvements ⭐
API Consistency ⭐// Before: Verbose construction
new IsInAssertion<T>(context, collection)
// After: Clean extension methods
value.IsIn(collection)
value.IsIn(collection, comparer)
value.IsIn(1, 2, 3) // params overloadSource Generator Quality ⭐The generator properly handles:
🎯 API Changes AssessmentThe snapshot files show the new generated methods: public static T_IsIn_IEnumerableT_Assertion<T> IsIn<T>(this IAssertionSource<T> source, IEnumerable<T> collection)
public static T_IsIn__Assertion<T> IsIn<T>(this IAssertionSource<T> source, params T[] collection)
// + equality comparer overloads and IsNotIn variantsThis is a non-breaking change since:
|
Fixes #3575