< Summary

Information
Class: MoreStructures.Lists.Searching.SearchHelperMethods
Assembly: MoreStructures
File(s): /home/runner/work/MoreStructures/MoreStructures/MoreStructures/Lists/Searching/SearchHelperMethods.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 19
Line coverage: 100%
Branch coverage
100%
Covered branches: 12
Total branches: 12
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
ValidateIndexesAndGetLength(...)100%12100%

File(s)

/home/runner/work/MoreStructures/MoreStructures/MoreStructures/Lists/Searching/SearchHelperMethods.cs

#LineLine coverage
 1using MoreStructures.Utilities;
 2
 3namespace MoreStructures.Lists.Searching;
 4
 5internal static class SearchHelperMethods
 6{
 7    public static int ValidateIndexesAndGetLength<T>(IEnumerable<T> source, int? fromIndex, int? toIndex)
 20298    {
 20299        var length = source.CountO1();
 202910        if (fromIndex != null && (fromIndex < 0 || fromIndex > length - 1))
 1811            throw new ArgumentOutOfRangeException(
 1812                nameof(fromIndex), $"Must be within the range of valid indexes for {source}.");
 201113        if (toIndex != null && (toIndex < 0 || toIndex > length - 1))
 814            throw new ArgumentOutOfRangeException(
 815                nameof(toIndex), $"Must be within the range of valid indexes for {source}.");
 200316        return length;
 200317    }
 18
 19}