< Summary - SonghayCore

Information
Class: Songhay.Extensions.TimeSpanExtensions
Assembly: SonghayCore
File(s): /home/rasx/sourceRoot/SonghayCore/SonghayCore/Extensions/TimeSpanExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 31
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
ListDays(...)100%10%
ListDays(...)0%20%

File(s)

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Extensions/TimeSpanExtensions.cs

#LineLine coverage
 1namespace Songhay.Extensions;
 2
 3/// <summary>
 4/// Extensions of <see cref="TimeSpan"/>.
 5/// </summary>
 6public static class TimeSpanExtensions
 7{
 8    /// <summary>
 9    /// Lists the days for the specified <see cref="TimeSpan"/>.
 10    /// </summary>
 11    /// <param name="span">The <see cref="TimeSpan" />.</param>
 012    public static IList<DateTime> ListDays(this TimeSpan span) => span.ListDays(DateTime.Now);
 13
 14    /// <summary>
 15    /// Lists the days for the specified <see cref="TimeSpan"/>
 16    /// from the specified start <see cref="DateTime"/>.
 17    /// </summary>
 18    /// <param name="span">The <see cref="TimeSpan" />.</param>
 19    /// <param name="startDate">The start date.</param>
 20    public static IList<DateTime> ListDays(this TimeSpan span, DateTime startDate)
 021    {
 022        var days = new List<DateTime>(span.Days);
 23
 024        for (int i = 0; i < span.Days; i++)
 025        {
 026            days.Add(startDate.AddDays(i));
 027        }
 28
 029        return days;
 030    }
 31}