Skip to content

Commit

Permalink
Multi-target test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau committed Jan 29, 2025
1 parent 4b7496c commit e85904d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/TestHelpers/RandomExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Microsoft.DurableTask;

public static class RandomExtensions
{
#if NET6_0_OR_GREATER
public static DateTimeOffset NextDateTimeOffset(this Random random, DateTimeOffset min, TimeSpan max)
{
ArgumentNullException.ThrowIfNull(random);
Expand All @@ -26,4 +27,5 @@ public static DateTime NextDateTime(this Random random, DateTime min, TimeSpan m

public static DateTime NextDateTime(this Random random, TimeSpan max)
=> random.NextDateTime(DateTime.UtcNow, max);
#endif
}
2 changes: 1 addition & 1 deletion test/TestHelpers/TestHelpers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6</TargetFramework>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit e85904d

Please sign in to comment.