Skip to content

Commit

Permalink
removed preprocessor based on .net version
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek-galezowski committed Jul 17, 2024
1 parent 972746e commit 9e4551e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
2 changes: 0 additions & 2 deletions src/netstandard2.0/AnyRoot/Numbers/AnyNumberExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Half>();
#endif
}
3 changes: 0 additions & 3 deletions src/netstandard2.0/AnyRoot/Time/AnyTimeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DateOnly>();
Expand All @@ -32,6 +31,4 @@ public static TimeOnly TimeOnly(this BasicGenerator gen)
{
return gen.Instance<TimeOnly>();
}
#endif

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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

0 comments on commit 9e4551e

Please sign in to comment.