fix: overload resolution for IEnumerable#639
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors a large number of extension methods in the ThatEnumerable suite to improve overload resolution for IEnumerable by replacing nullable and generic type parameters with non‑nullable IEnumerable. The changes simplify method signatures and return types across various collection verification methods.
- Updated overloads for methods such as MoreThan, LessThan, IsInDescendingOrder, IsInAscendingOrder, etc.
- Standardized the use of IThat in place of IThat<IEnumerable?>, improving clarity and consistency.
- Revised related return types and underlying constraint constructions accordingly.
Reviewed Changes
Copilot reviewed 20 out of 55 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Source/aweXpect/That/Collections/ThatEnumerable.MoreThan.cs | Changed method signature to use IThat instead of nullable. |
| Source/aweXpect/That/Collections/ThatEnumerable.LessThan.cs | Updated parameter types to non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.IsInDescendingOrder.cs | Refactored ordering methods to standardize on non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.IsInAscendingOrder.cs | Revised method signatures to enhance overload resolution. |
| Source/aweXpect/That/Collections/ThatEnumerable.IsEqualTo.cs | Changed equality method signature to use IThat. |
| Source/aweXpect/That/Collections/ThatEnumerable.IsContainedIn.cs | Updated containment verification to use non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.HasSingle.cs | Simplified HasSingle signature by removing unnecessary generic types. |
| Source/aweXpect/That/Collections/ThatEnumerable.HasCount.cs | Standardized count verifications across different overloads. |
| Source/aweXpect/That/Collections/ThatEnumerable.Exactly.cs | Updated exactly count check method signature. |
| Source/aweXpect/That/Collections/ThatEnumerable.EndsWith.cs | Changed method signature for EndsWith methods to use non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.Elements.Satisfy.cs | Updated signature consistency in predicate-based methods. |
| Source/aweXpect/That/Collections/ThatEnumerable.Elements.ComplyWith.cs | Revised constraint application to use non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.Elements.AreEquivalentTo.cs | Updated equivalence check signatures to non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.Elements.AreEqualTo.cs | Standardized signatures in equality verification for elements. |
| Source/aweXpect/That/Collections/ThatEnumerable.Contains.cs | Changed methods to use non‑nullable IEnumerable in containment checks. |
| Source/aweXpect/That/Collections/ThatEnumerable.Between.cs | Updated Between method signature for improved overload resolution. |
| Source/aweXpect/That/Collections/ThatEnumerable.AtMost.cs | Modified method signature to use non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.AtLeast.cs | Updated method signature to use non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.AreAllUnique.cs | Refactored uniqueness methods for consistency with non‑nullable IEnumerable. |
| Source/aweXpect/That/Collections/ThatEnumerable.All.cs | Updated All method signature to use IThat exclusively. |
Comments suppressed due to low confidence (5)
Source/aweXpect/That/Collections/ThatEnumerable.MoreThan.cs:32
- The change from IThat<IEnumerable?> to IThat improves overload resolution, but please verify that this API change is compatible with all caller scenarios, especially regarding the handling of null subjects.
public static ElementsForEnumerable<IEnumerable> MoreThan(
Source/aweXpect/That/Collections/ThatEnumerable.IsEqualTo.cs:285
- Changing the signature from using nullable subject types to non‑nullable IEnumerable enhances clarity; ensure that all consumers of this API have been updated accordingly.
IsEqualTo<TItem>(
Source/aweXpect/That/Collections/ThatEnumerable.HasCount.cs:89
- Standardizing the parameter to IThat streamlines the API; confirm that this change does not omit valid use cases where a nullable subject might be expected.
public static AndOrResult<IEnumerable, IThat<IEnumerable>> HasCount(
Source/aweXpect/That/Collections/ThatEnumerable.EndsWith.cs:110
- Updating the EndsWith overload to use a non‑nullable IEnumerable improves overload resolution; please check that existing usage patterns are fully supported.
EndsWith<TItem>(
Source/aweXpect/That/Collections/ThatEnumerable.All.cs:30
- The refactoring of the All method to use IThat aligns with the overall API improvements; verify that any dependencies on previous nullable types are updated accordingly.
public static ElementsForEnumerable<IEnumerable> All(
b596437 to
b044122
Compare
|
…le` (#639) by Valentin Breuß
…le` (#639) by Valentin Breuß
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpectDetails
The final mutation score is 85.23%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
|
This is addressed in release v2.16.0. |



Improve overload resolution for
IEnumerableby replacing nullable and generic type parameters with non‑nullableIEnumerable.