Skip to content

Commit

Permalink
Fix overload resolution in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-sunset committed Aug 10, 2022
1 parent c71c076 commit 2e69e73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RangeExtensions.Tests/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void EqualValueOrException<T>(
}
}

public static void EqualValueOrException<T>(
public static void EqualSequenceOrException<T>(
Func<IEnumerable<T>> expectedValueSource,
Func<IEnumerable<T>> actualValueSource,
bool allowInherited = false)
Expand Down
4 changes: 1 addition & 3 deletions RangeExtensions.Tests/RangeEnumerable.ICollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public void CopyTo_MatchesICollectionCopyTo(Range range, IEnumerable<int> enumer
var rangeEnumerable = range.AsEnumerable();
var numbersArray = enumerable.ToArray();

// This one is really expensive due to element count * 'ValidRangePairs' * 'Data.Indexes' cost.
// Using generics should somewhat help with its performance.
static int[] CopyCollection<TCollection>(int index, TCollection collection)
where TCollection : ICollection<int>
{
Expand All @@ -74,7 +72,7 @@ static int[] CopyCollection<TCollection>(int index, TCollection collection)

foreach (var index in Data.Indexes(numbersArray))
{
AssertHelpers.EqualValueOrException(
AssertHelpers.EqualSequenceOrException(
() => CopyCollection(index, numbersArray),
() => CopyCollection(index, rangeEnumerable));
}
Expand Down

0 comments on commit 2e69e73

Please sign in to comment.