From 9e4551e75dd2ecbd48257a5d07863b51a4f17b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ga=C5=82=C4=99zowski?= Date: Wed, 17 Jul 2024 22:49:28 +0200 Subject: [PATCH] removed preprocessor based on .net version --- .../AnyRoot/Numbers/AnyNumberExtensions.cs | 2 -- .../AnyRoot/Time/AnyTimeExtensions.cs | 3 --- .../FakeChainElements/DateOnlyResolution.cs | 15 --------------- .../FakeChainElements/HalfResolution.cs | 17 +---------------- 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/netstandard2.0/AnyRoot/Numbers/AnyNumberExtensions.cs b/src/netstandard2.0/AnyRoot/Numbers/AnyNumberExtensions.cs index 1ec0475..511b4d7 100644 --- a/src/netstandard2.0/AnyRoot/Numbers/AnyNumberExtensions.cs +++ b/src/netstandard2.0/AnyRoot/Numbers/AnyNumberExtensions.cs @@ -71,7 +71,5 @@ public static byte PositiveDigit(this BasicGenerator gen) return gen.InstanceOf(InlineGenerators.PositiveDigit()); } -#if NET5_0_OR_GREATER public static Half Half(this BasicGenerator gen) => gen.Instance(); -#endif } diff --git a/src/netstandard2.0/AnyRoot/Time/AnyTimeExtensions.cs b/src/netstandard2.0/AnyRoot/Time/AnyTimeExtensions.cs index 994709c..f204871 100644 --- a/src/netstandard2.0/AnyRoot/Time/AnyTimeExtensions.cs +++ b/src/netstandard2.0/AnyRoot/Time/AnyTimeExtensions.cs @@ -22,7 +22,6 @@ public static TimeSpan TimeSpan(this BasicGenerator gen) } - #if NET6_0_OR_GREATER public static DateOnly DateOnly(this BasicGenerator gen) { return gen.Instance(); @@ -32,6 +31,4 @@ public static TimeOnly TimeOnly(this BasicGenerator gen) { return gen.Instance(); } - #endif - } diff --git a/src/netstandard2.0/TypeResolution/FakeChainElements/DateOnlyResolution.cs b/src/netstandard2.0/TypeResolution/FakeChainElements/DateOnlyResolution.cs index a4db49a..05d3db7 100644 --- a/src/netstandard2.0/TypeResolution/FakeChainElements/DateOnlyResolution.cs +++ b/src/netstandard2.0/TypeResolution/FakeChainElements/DateOnlyResolution.cs @@ -3,7 +3,6 @@ namespace TddXt.TypeResolution.FakeChainElements; -#if NET6_0_OR_GREATER public class DateOnlyResolution : IResolution { private static DateOnly _current = DateOnly.FromDateTime(DateTime.UtcNow); @@ -22,17 +21,3 @@ public object Apply(InstanceGenerator instanceGenerator, GenerationRequest reque } } } -#else -public class DateOnlyResolution : IResolution -{ - public bool AppliesTo(Type type) - { - return false; - } - - public object Apply(InstanceGenerator instanceGenerator, GenerationRequest request, Type type) - { - throw new NotSupportedException("Supported in .NET 6 or higher"); - } -} -#endif diff --git a/src/netstandard2.0/TypeResolution/FakeChainElements/HalfResolution.cs b/src/netstandard2.0/TypeResolution/FakeChainElements/HalfResolution.cs index d8483a4..b54bf56 100644 --- a/src/netstandard2.0/TypeResolution/FakeChainElements/HalfResolution.cs +++ b/src/netstandard2.0/TypeResolution/FakeChainElements/HalfResolution.cs @@ -2,7 +2,7 @@ using TddXt.AnyExtensibility; namespace TddXt.TypeResolution.FakeChainElements; -#if NET5_0_OR_GREATER + public class HalfResolution : IResolution { private static readonly object SyncRoot = new(); @@ -21,18 +21,3 @@ public object Apply(InstanceGenerator instanceGenerator, GenerationRequest reque } } } -#else -public class HalfResolution : IResolution -{ - public bool AppliesTo(Type type) - { - return false; - } - - public object Apply(InstanceGenerator instanceGenerator, GenerationRequest request, Type type) - { - throw new NotSupportedException("Supported in .NET 6 or higher"); - } -} -#endif -