From b68c804b466eac25b7ec4932f1c50af41f741273 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 3 Apr 2023 14:18:02 +0100 Subject: [PATCH] test: exclude uncoverable Age overload from coverage --- X10D/src/Time/DateTimeExtensions.cs | 4 +++- X10D/src/Time/DateTimeOffsetExtensions.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/X10D/src/Time/DateTimeExtensions.cs b/X10D/src/Time/DateTimeExtensions.cs index 3210aa5..2993b03 100644 --- a/X10D/src/Time/DateTimeExtensions.cs +++ b/X10D/src/Time/DateTimeExtensions.cs @@ -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); diff --git a/X10D/src/Time/DateTimeOffsetExtensions.cs b/X10D/src/Time/DateTimeOffsetExtensions.cs index eeb8a67..977cc60 100644 --- a/X10D/src/Time/DateTimeOffsetExtensions.cs +++ b/X10D/src/Time/DateTimeOffsetExtensions.cs @@ -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);