< Summary

Class:C:\Users\Vaibhav\github\arbitrary-extensions\src\ArbitraryExtensions\Core\DateTimeExtensions.cs
Assembly:Default
File(s):C:\Users\Vaibhav\github\arbitrary-extensions\src\ArbitraryExtensions\Core\DateTimeExtensions.cs
Covered lines:2
Uncovered lines:0
Coverable lines:2
Total lines:20
Line coverage:100% (2 of 2)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Coverage History

File(s)

C:\Users\Vaibhav\github\arbitrary-extensions\src\ArbitraryExtensions\Core\DateTimeExtensions.cs

#LineLine coverage
 1using System;
 2namespace ArbitraryExtensions.Core
 3{
 4    public static class DateTimeExtensions
 5    {
 6        /// <summary>Gets the elapsed timespan between the provided value and DateTime.Now</summary>
 7        /// <param name="value">the start datetime value</param>
 8        /// <param name="endDate">the end datetime</param>
 9        /// <returns>elapsed timespan instance</returns>
 110        public static TimeSpan Elapsed(this DateTime value, DateTime endDate) => endDate.Subtract(value);
 11
 12        /// <summary>Gets if the input date is between the provided start and end date</summary>
 13        /// <param name="currentDate">the input date</param>
 14        /// <param name="startDate">the start date</param>
 15        /// <param name="endDate">the end date</param>
 16        /// <returns>True, if the input date is within the range, else False</returns>
 17        public static bool IsInRange(this DateTime currentDate, DateTime startDate, DateTime endDate)
 118            => (currentDate >= startDate && currentDate <= endDate);
 19    }
 20}