1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-09 22:55:42 +00:00

test: exclude uncoverable Age overload from coverage

This commit is contained in:
Oliver Booth 2023-04-03 14:18:02 +01:00
parent 15d0f93f8b
commit b68c804b46
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System.Diagnostics.Contracts;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.CompilerServices;
@ -16,6 +17,7 @@ public static class DateTimeExtensions
#else
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
#endif
[ExcludeFromCodeCoverage]
public static int Age(this DateTime value)
{
return value.Age(DateTime.Today);

View File

@ -1,4 +1,5 @@
using System.Diagnostics.Contracts;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
namespace X10D.Time;
@ -19,6 +20,7 @@ public static class DateTimeOffsetExtensions
#else
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
#endif
[ExcludeFromCodeCoverage]
public static int Age(this DateTimeOffset value)
{
return value.Age(DateTime.Today);