< Summary - SonghayCore

Information
Class: Songhay.Extensions.ITemporalExtensions
Assembly: SonghayCore
File(s): /home/rasx/sourceRoot/SonghayCore/SonghayCore/Extensions/ITemporalExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 30
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
SetDefaults(...)100%10%
SetDefaults(...)0%20%

File(s)

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

#LineLine coverage
 1namespace Songhay.Extensions;
 2
 3/// <summary>
 4/// Extensions of <see cref="ITemporal"/>
 5/// </summary>
 6// ReSharper disable once InconsistentNaming
 7public static class ITemporalExtensions
 8{
 9    /// <summary>
 10    /// Sets conventional default values
 11    /// for <see cref="ITemporal"/> data.
 12    /// </summary>
 13    /// <param name="data">The <see cref="ITemporal"/> data.</param>
 014    public static void SetDefaults(this ITemporal data) => data.SetDefaults(endDate: null);
 15
 16    /// <summary>
 17    /// Sets conventional default values
 18    /// for <see cref="ITemporal"/> data.
 19    /// </summary>
 20    /// <param name="data">The <see cref="ITemporal"/> data.</param>
 21    /// <param name="endDate">Sets <see cref="ITemporal.EndDate"/>.</param>
 22    public static void SetDefaults(this ITemporal? data, DateTime? endDate)
 023    {
 024        if (data == null) return;
 25
 026        data.InceptDate = DateTime.Now;
 027        data.ModificationDate = data.InceptDate;
 028        data.EndDate = endDate;
 029    }
 30}